{"id":1626,"date":"2017-11-01T13:58:23","date_gmt":"2017-11-01T13:58:23","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=1626"},"modified":"2017-11-01T17:19:26","modified_gmt":"2017-11-01T17:19:26","slug":"setup-snmp-v3-on-debian-or-ubuntu","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/setup-snmp-v3-on-debian-or-ubuntu\/","title":{"rendered":"Setup SNMP v3 on Debian or Ubuntu"},"content":{"rendered":"<p>All the following commands should work on Ubuntu, or just about any other Debian based Linux distro.\u00a0 If you have a firewall on the server, you&#8217;ll need to allow UDP on port 161.<\/p>\n<p><strong>Install SNMP<\/strong><\/p>\n<p>Install snmp, snmpd, and libsnmp.<\/p>\n<pre>sudo apt-get -y install snmp snmpd libsnmp-dev<\/pre>\n<p>Stop the snmpd service so we can add a user<\/p>\n<pre>sudo service snmpd stop<\/pre>\n<p><strong>Add SNMP v3 user<\/strong><\/p>\n<ul>\n<li>Change AuthPassword to your Authentication password<\/li>\n<li>Change CryptoPassword to your Crypto Password<\/li>\n<li>Change privUser to your private users username<\/li>\n<\/ul>\n<pre>sudo net-snmp-config --create-snmpv3-user -ro -A AuthPassword -X CryptoPassword -a MD5 -x AES privUser<\/pre>\n<p><strong>Change System Location, System Contact, and allow SNMP on all interfaces<br \/>\n<\/strong><\/p>\n<p>Open up the SNMP config file usually in \/etc\/snmp\/snmpd.conf<\/p>\n<pre>vi \/etc\/snmp\/snmpd.conf<\/pre>\n<p>Search for &#8220;sysLocation&#8221;\u00a0 and change to whatever your system location is.<\/p>\n<p>Search for &#8220;sysContact&#8221; and change it.\u00a0 It should be right underneath sysLocation.<\/p>\n<p>Now allow SNMP on all interfaces.\u00a0 Find the following line and comment it out.<\/p>\n<pre>agentAddress udp:127.0.0.1:161<\/pre>\n<p>Add a # to the beginning.<\/p>\n<pre>#agentAddress udp:127.0.0.1:161<\/pre>\n<p>Now find this line (should be a couple lines down from the line you just commented out)<\/p>\n<pre>#agentAddress udp:161,udp6:[::1]:161<\/pre>\n<p>and uncomment it<\/p>\n<pre>agentAddress udp:161,udp6:[::1]:161<\/pre>\n<p>That will enable it so you can read the SNMP info using the servers IP address, as opposed to being limited to localhost.<\/p>\n<p><strong>Start the SNMP service and Test<\/strong><\/p>\n<p>Start the SNMP service<\/p>\n<pre>service snmpd start<\/pre>\n<p>Test with<\/p>\n<pre>snmpwalk -v3 -a MD5 -A AuthPassword -X CryptoPassword -l authNoPriv -u privUser localhost<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>All the following commands should work on Ubuntu, or just about any other Debian based Linux distro.\u00a0 If you have a firewall on the server, you&#8217;ll need to allow UDP on port 161. Install SNMP Install snmp, snmpd, and libsnmp. &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/setup-snmp-v3-on-debian-or-ubuntu\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[264,3,130,28],"tags":[51,7,133,261,171,360,49],"class_list":["post-1626","post","type-post","status-publish","format-standard","hentry","category-debian","category-linux","category-snmp","category-ubuntu","tag-debian","tag-linux-2","tag-snmp-2","tag-snmp-v3","tag-snmpd","tag-snmpv3","tag-ubuntu-2"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/1626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=1626"}],"version-history":[{"count":10,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/1626\/revisions"}],"predecessor-version":[{"id":1695,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/1626\/revisions\/1695"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=1626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=1626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=1626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}