{"id":812,"date":"2020-03-02T20:33:23","date_gmt":"2020-03-03T04:33:23","guid":{"rendered":"https:\/\/angrysysadmins.tech\/?p=812"},"modified":"2020-03-02T20:33:23","modified_gmt":"2020-03-03T04:33:23","slug":"ossec-how-to-install-ossec-agent-and-server-on-linux","status":"publish","type":"post","link":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/","title":{"rendered":"OSSEC: How to Install OSSEC Agent and Server on Linux"},"content":{"rendered":"<p>Each distro needs different packages to compile the code there are pre-made binaries available,<\/p>\n<h2>Build Dependencies<\/h2>\n<p>Each distro needs different packages to compile the code Install the appropriate packages for you distro. I&#8217;ll update them as I discover them<\/p>\n<h3>Ubuntu 16-18<\/h3>\n<pre>apt install -y unzip build-essential zlib1g-dev libsqlite3-dev libpcre2-dev wget unzip make gcc php php-cli php-common libapache2-mod-php apache2-utils sendmail inotify-tools libevent-dev libssl-dev<\/pre>\n<h3>Arch Linux<\/h3>\n<pre>Pacman -Sy unzip base-devel\r\nyay -S sendmail\r\n(still a work in progress)<\/pre>\n<p>&nbsp;<\/p>\n<h2>Compiling<\/h2>\n<p>To get started, we need to get the latest version of the source from the github releases page. At the time of writing this, version 3.6 is the latest<\/p>\n<pre>wget https:\/\/codeload.github.com\/ossec\/ossec-hids\/zip\/3.6.0<\/pre>\n<p>Next, we can extract the zip and start the installer. This both installs the package and compiles it.<\/p>\n<pre>unzip 3.6.0\r\ncd ossec-hids-3.6.0\r\nsudo .\/install.sh<\/pre>\n<p>For my setup, I&#8217;ll be doing a hybrid install. This option installs both the server and the client. If you only want the agent, select the agent. Fill out the options according to your needs and wants.<\/p>\n<p>&nbsp;<\/p>\n<h2>Agent Setup<\/h2>\n<p>&nbsp;<\/p>\n<h2>Running<\/h2>\n<p>After you are done installing, run the following as root:<\/p>\n<pre>\/var\/ossec\/bin\/ossec-control start<\/pre>\n<p>If you are hosting the server, you can check if it is running by running the following<\/p>\n<pre>netstat -tulpn<\/pre>\n<p>This will show and output of all the listening ports if you see port 1514\/udp or 1515\/tcp active it is working. example output:<\/p>\n<pre>udp6     0     0     :::1514    :::*     30108\/ossec-remoted\r\ntcp6     0     0     :::1515    :::*     30108\/ossec-remoted<\/pre>\n<p>As you can see, the server is running. Now all you need to do is create a firewall rule for it. See <strong>FIREWALL ARTICLE <\/strong>on how to do it<\/p>\n<p>&nbsp;<\/p>\n<p>To see what agents are connected, login to the server and run:<\/p>\n<p>\/var\/ossec\/bin\/Agent_control -lc<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Each distro needs different packages to compile the code there are pre-made binaries available, Build Dependencies Each distro needs different packages to compile the code Install the appropriate packages for you distro. I&#8217;ll update them as I discover them Ubuntu 16-18 apt install -y unzip build-essential zlib1g-dev libsqlite3-dev libpcre2-dev wget unzip make gcc php php-cli <br \/><a class=\"read-more-button\" href=\"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,191,190],"tags":[],"coauthors":[39],"class_list":["post-812","post","type-post","status-publish","format-standard","hentry","category-linux","category-ossec","category-security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>OSSEC: How to Install OSSEC Agent and Server on Linux - Angry Sysadmins<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OSSEC: How to Install OSSEC Agent and Server on Linux - Angry Sysadmins\" \/>\n<meta property=\"og:description\" content=\"Each distro needs different packages to compile the code there are pre-made binaries available, Build Dependencies Each distro needs different packages to compile the code Install the appropriate packages for you distro. I&#8217;ll update them as I discover them Ubuntu 16-18 apt install -y unzip build-essential zlib1g-dev libsqlite3-dev libpcre2-dev wget unzip make gcc php php-cli Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Angry Sysadmins\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-03T04:33:23+00:00\" \/>\n<meta name=\"author\" content=\"Ryan Parker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ryan Parker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/2020\\\/03\\\/grassyloki\\\/ossec-how-to-install-ossec-agent-and-server-on-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/2020\\\/03\\\/grassyloki\\\/ossec-how-to-install-ossec-agent-and-server-on-linux\\\/\"},\"author\":{\"name\":\"Ryan Parker\",\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/#\\\/schema\\\/person\\\/651321cd35645fb6a4d8a75b7bc7c199\"},\"headline\":\"OSSEC: How to Install OSSEC Agent and Server on Linux\",\"datePublished\":\"2020-03-03T04:33:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/2020\\\/03\\\/grassyloki\\\/ossec-how-to-install-ossec-agent-and-server-on-linux\\\/\"},\"wordCount\":245,\"commentCount\":1,\"articleSection\":[\"Linux\",\"OSSEC\",\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/2020\\\/03\\\/grassyloki\\\/ossec-how-to-install-ossec-agent-and-server-on-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/2020\\\/03\\\/grassyloki\\\/ossec-how-to-install-ossec-agent-and-server-on-linux\\\/\",\"url\":\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/2020\\\/03\\\/grassyloki\\\/ossec-how-to-install-ossec-agent-and-server-on-linux\\\/\",\"name\":\"OSSEC: How to Install OSSEC Agent and Server on Linux - Angry Sysadmins\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/#website\"},\"datePublished\":\"2020-03-03T04:33:23+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/#\\\/schema\\\/person\\\/651321cd35645fb6a4d8a75b7bc7c199\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/2020\\\/03\\\/grassyloki\\\/ossec-how-to-install-ossec-agent-and-server-on-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/2020\\\/03\\\/grassyloki\\\/ossec-how-to-install-ossec-agent-and-server-on-linux\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/2020\\\/03\\\/grassyloki\\\/ossec-how-to-install-ossec-agent-and-server-on-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/angrysysadmins.tech\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OSSEC: How to Install OSSEC Agent and Server on Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/#website\",\"url\":\"https:\\\/\\\/angrysysadmins.tech\\\/\",\"name\":\"Angry Sysadmins\",\"description\":\"A site full of angry sysadmins here to vent and help\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/angrysysadmins.tech\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/angrysysadmins.tech\\\/#\\\/schema\\\/person\\\/651321cd35645fb6a4d8a75b7bc7c199\",\"name\":\"Ryan Parker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fc12b1a02765c8017062ee6f41eb34a7b14575bcd8acd7da40e176fe8f12b10f?s=96&d=mm&r=g664d0e05248e51cb1d71b3f66c6f929d\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fc12b1a02765c8017062ee6f41eb34a7b14575bcd8acd7da40e176fe8f12b10f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fc12b1a02765c8017062ee6f41eb34a7b14575bcd8acd7da40e176fe8f12b10f?s=96&d=mm&r=g\",\"caption\":\"Ryan Parker\"},\"description\":\"Professionally im a Infrastructure Security Specialist. I current maintain a homelab with about 3TB of RAM, 240+ TB of storage, tons of CPU cores, and 100gbit networking backbone in the garage running up my electricity bill.\",\"url\":\"https:\\\/\\\/angrysysadmins.tech\\\/index.php\\\/author\\\/grassyloki\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OSSEC: How to Install OSSEC Agent and Server on Linux - Angry Sysadmins","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/","og_locale":"en_US","og_type":"article","og_title":"OSSEC: How to Install OSSEC Agent and Server on Linux - Angry Sysadmins","og_description":"Each distro needs different packages to compile the code there are pre-made binaries available, Build Dependencies Each distro needs different packages to compile the code Install the appropriate packages for you distro. I&#8217;ll update them as I discover them Ubuntu 16-18 apt install -y unzip build-essential zlib1g-dev libsqlite3-dev libpcre2-dev wget unzip make gcc php php-cli Read More &raquo;","og_url":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/","og_site_name":"Angry Sysadmins","article_published_time":"2020-03-03T04:33:23+00:00","author":"Ryan Parker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ryan Parker","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/#article","isPartOf":{"@id":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/"},"author":{"name":"Ryan Parker","@id":"https:\/\/angrysysadmins.tech\/#\/schema\/person\/651321cd35645fb6a4d8a75b7bc7c199"},"headline":"OSSEC: How to Install OSSEC Agent and Server on Linux","datePublished":"2020-03-03T04:33:23+00:00","mainEntityOfPage":{"@id":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/"},"wordCount":245,"commentCount":1,"articleSection":["Linux","OSSEC","Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/","url":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/","name":"OSSEC: How to Install OSSEC Agent and Server on Linux - Angry Sysadmins","isPartOf":{"@id":"https:\/\/angrysysadmins.tech\/#website"},"datePublished":"2020-03-03T04:33:23+00:00","author":{"@id":"https:\/\/angrysysadmins.tech\/#\/schema\/person\/651321cd35645fb6a4d8a75b7bc7c199"},"breadcrumb":{"@id":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/angrysysadmins.tech\/index.php\/2020\/03\/grassyloki\/ossec-how-to-install-ossec-agent-and-server-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/angrysysadmins.tech\/"},{"@type":"ListItem","position":2,"name":"OSSEC: How to Install OSSEC Agent and Server on Linux"}]},{"@type":"WebSite","@id":"https:\/\/angrysysadmins.tech\/#website","url":"https:\/\/angrysysadmins.tech\/","name":"Angry Sysadmins","description":"A site full of angry sysadmins here to vent and help","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/angrysysadmins.tech\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/angrysysadmins.tech\/#\/schema\/person\/651321cd35645fb6a4d8a75b7bc7c199","name":"Ryan Parker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/fc12b1a02765c8017062ee6f41eb34a7b14575bcd8acd7da40e176fe8f12b10f?s=96&d=mm&r=g664d0e05248e51cb1d71b3f66c6f929d","url":"https:\/\/secure.gravatar.com\/avatar\/fc12b1a02765c8017062ee6f41eb34a7b14575bcd8acd7da40e176fe8f12b10f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fc12b1a02765c8017062ee6f41eb34a7b14575bcd8acd7da40e176fe8f12b10f?s=96&d=mm&r=g","caption":"Ryan Parker"},"description":"Professionally im a Infrastructure Security Specialist. I current maintain a homelab with about 3TB of RAM, 240+ TB of storage, tons of CPU cores, and 100gbit networking backbone in the garage running up my electricity bill.","url":"https:\/\/angrysysadmins.tech\/index.php\/author\/grassyloki\/"}]}},"_links":{"self":[{"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/posts\/812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/comments?post=812"}],"version-history":[{"count":7,"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/posts\/812\/revisions"}],"predecessor-version":[{"id":826,"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/posts\/812\/revisions\/826"}],"wp:attachment":[{"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/media?parent=812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/categories?post=812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/tags?post=812"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/angrysysadmins.tech\/index.php\/wp-json\/wp\/v2\/coauthors?post=812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}