{"id":130,"date":"2009-02-02T21:48:00","date_gmt":"2009-02-02T21:48:00","guid":{"rendered":"https:\/\/defragged.org\/ossec\/?p=130"},"modified":"2020-07-02T21:48:51","modified_gmt":"2020-07-02T21:48:51","slug":"agentless-monitoring-using-public-key-authentication","status":"publish","type":"post","link":"https:\/\/defragged.org\/ossec\/2009\/02\/agentless-monitoring-using-public-key-authentication\/","title":{"rendered":"Agentless monitoring using public key authentication"},"content":{"rendered":"\n<p>As a follow up to the previous post (<a href=\"http:\/\/www.ossec.net\/dcid\/?p=158\">Agentless monitoring<\/a>), I will now show how to use public key authentication instead of passwords to access the remote boxes.<\/p>\n\n\n\n<h3>1- Adding the remote host<\/h3>\n\n\n\n<p>When adding the remote host, you need to provide the password as \u201cNOPASS\u201d:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  # <strong>\/var\/ossec\/agentless\/register_host.sh add root@xx.net NOPASS<\/strong>\n   *Host root@xx.netl added.<\/pre>\n\n\n\n<h3>2-Adding the public key<\/h3>\n\n\n\n<p>The public key must be created by the user ossec inside the ossec home directory. To do that, follow these steps:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># <strong>sudo -u ossec ssh-keygen<\/strong><\/pre>\n\n\n\n<p>It will create the public keys inside&nbsp;<em>\/var\/ossec\/.ssh<\/em>&nbsp;. After that, just scp the public key to the remote box and your password less connection should work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a follow up to the previous post (Agentless monitoring), I will now show how to use public key authentication instead of passwords to access the remote boxes. 1- Adding the remote host When adding the remote host, you need to provide the password as \u201cNOPASS\u201d: # \/var\/ossec\/agentless\/register_host.sh add root@xx.net NOPASS *Host root@xx.netl added. 2-Adding [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/130"}],"collection":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/comments?post=130"}],"version-history":[{"count":1,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/130\/revisions"}],"predecessor-version":[{"id":131,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/130\/revisions\/131"}],"wp:attachment":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/media?parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/categories?post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/tags?post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}