{"id":22720,"date":"2021-01-27T20:41:08","date_gmt":"2021-01-27T12:41:08","guid":{"rendered":"http:\/\/www.idc.net\/help\/22720\/"},"modified":"2022-04-29T14:34:15","modified_gmt":"2022-04-29T06:34:15","slug":"ubuntu%e9%85%8d%e7%bd%aesnmpv3%e7%bd%91%e7%bb%9c%e7%ae%a1%e7%90%86%e5%8d%8f%e8%ae%ae","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/22720\/","title":{"rendered":"Ubuntu\u914d\u7f6eSNMPv3\u7f51\u7edc\u7ba1\u7406\u534f\u8bae"},"content":{"rendered":"<div class=\"idc_table\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">SNMPv3\u5b9a\u4e49\u4e86\u65b0\u7684\u4f53\u7cfb\u7ed3\u6784\uff0c\u5e76\u5728\u5176\u4e2d\u5305\u542b\u4e86\u5bf9SNMPv1\u548cSNMPv2c\u7684\u517c\u5bb9\uff0c\u5373\u8fd9\u4e2a\u65b0\u7684\u4f53\u7cfb\u7ed3\u6784\u4e5f\u9002\u7528\u4e8eSNMPv1\u53caSNMPv2c\uff0c\u5f25\u8865\u4e86SNMP\u6ca1\u6709\u5b8c\u6574\u4f53\u7cfb\u7ed3\u6784\u7684\u7f3a\u70b9\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u5728SNMPv3\u4e2d\uff0c\u7ba1\u7406\u8fdb\u7a0b\u4e0e\u4ee3\u7406\u7edf\u79f0\u4e3aSNMP\u5b9e\u4f53\uff08entity\uff09\u3002SNMP\u5b9e\u4f53\u7531SNMP\u534f\u8bae\u5f15\u64ce\uff08engine\uff09\u548c\u5e94\u7528\u7a0b\u5e8f\uff08application\uff09\u7ec4\u6210\u3002SNMP\u5b9e\u4f53\u5305\u542b\u4e00\u7cfb\u5217\u6a21\u5757\uff0c\u6a21\u5757\u4e4b\u95f4\u76f8\u4e92\u4f5c\u7528\u6765\u63d0\u4f9b\u670d\u52a1\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" style=\"max-width: 100%;border-radius: 5px 5px 5px 5px;margin: 0px 10px auto;width: 100%;height: 100%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/6190bdeb2ab3f51d91bc3cdd.jpg\">  <\/p>\n<h3><span style=\"font-size: 18px;color: #f48a00;padding-left: 10px;border-left: 4px solid #ffe3a3\">\u4e3a\u4ec0\u4e48\u9700\u8981\u4f7f\u7528SNMPv3<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u5c3d\u7ba1SNMPv3\u6240\u589e\u52a0\u7684\u52a0\u5bc6\u529f\u80fd\u5e76\u4e0d\u5f71\u54cd\u534f\u8bae\u5c42\u9762\uff0c\u4f46\u662f\u65b0\u7684\u6587\u672c\u60ef\u4f8b\u3001\u6982\u5ff5\u53ca\u672f\u8bed\u4f7f\u5f97\u5b83\u770b\u8d77\u6765\u5f88\u4e0d\u4e00\u6837\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">SNMPv3\u5728SNMP\u7684\u57fa\u7840\u4e4b\u4e0a\u589e\u5f3a\u4e86\u5b89\u5168\u6027\u4ee5\u53ca\u8fdc\u7a0b\u914d\u7f6e\u529f\u80fd\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u6700\u521d\uff0cSNMP\u6700\u5927\u7684\u7f3a\u70b9\u5c31\u662f\u5b89\u5168\u6027\u5f31\u3002SNMP\u7684\u7b2c\u4e00\u4e0e\u7b2c\u4e8c\u4e2a\u7248\u672c\u4e2d\uff0c\u8eab\u4efd\u9a8c\u8bc1\u4ec5\u4ec5\u662f\u5728\u7ba1\u7406\u5458\u4e0e\u4ee3\u7406\u95f4\u4f20\u9001\u4e00\u4e2a\u660e\u6587\u7684\u5bc6\u7801\u800c\u5df2\u3002\u76ee\u524d\u6bcf\u4e00\u4e2aSNMPv3\u7684\u4fe1\u606f\u90fd\u5305\u542b\u4e86\u88ab\u7f16\u7801\u62108\u8fdb\u5236\u7684\u5b89\u5168\u53c2\u6570\u3002\u8fd9\u4e9b\u5b89\u5168\u53c2\u6570\u7684\u5177\u4f53\u610f\u4e49\u7531\u6240\u9009\u7528\u7684\u5b89\u5168\u6a21\u578b\u51b3\u5b9a\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">SNMPv3\u63d0\u4f9b\u4e86\u91cd\u8981\u7684\u5b89\u5168\u7279\u6027\uff1a<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u2022\u4fdd\u5bc6\u6027 \u2014\u2014 \u52a0\u5bc6\u6570\u636e\u5305\u4ee5\u9632\u6b62\u672a\u7ecf\u6388\u6743\u7684\u6e90\u76d1\u542c\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u2022\u5b8c\u6574\u6027 \u2014\u2014 \u6570\u636e\u7684\u5b8c\u6574\u6027\u7279\u6027\u786e\u4fdd\u6570\u636e\u5728\u4f20\u8f93\u7684\u65f6\u5019\u6ca1\u6709\u88ab\u5e72\u6270\uff0c\u5e76\u4e14\u5305\u542b\u4e86\u53ef\u9009\u7684\u6570\u636e\u54cd\u5e94\u4fdd\u62a4\u673a\u5236\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u2022\u8eab\u4efd\u9a8c\u8bc1 \u2014\u2014 \u68c0\u67e5\u6570\u636e\u662f\u5426\u6765\u81ea\u4e00\u4e2a\u5408\u6cd5\u7684\u6e90\u3002<\/p>\n<h3><span style=\"font-size: 18px;color: #f48a00;padding-left: 10px;border-left: 4px solid #ffe3a3\">\u5728ubuntu\u4e2d\u5b89\u88c5SNMP\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u6253\u5f00\u7ec8\u7aef\u8fd0\u884c\u4e0b\u5217\u547d\u4ee4<\/p>\n<pre><code>sudo&nbsp;apt-get&nbsp;install&nbsp;snmpd&nbsp;snmp\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u5b89\u88c5\u5b8c\u6210\u540e\u9700\u8981\u505a\u5982\u4e0b\u6539\u53d8\u3002<\/p>\n<h4><span style=\"font-size: 16px;color: #f48a00\">\u914d\u7f6eSNMPv3<\/span><\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u83b7\u5f97\u4ece\u5916\u90e8\u5b88\u62a4\u8fdb\u7a0b\u8bbf\u95ee\u7684\u6743\u9650<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u9ed8\u8ba4\u7684\u5b89\u88c5\u4ec5\u63d0\u4f9b\u672c\u5730\u7684\u8bbf\u95ee\u6743\u9650\uff0c\u5982\u679c\u60f3\u8981\u83b7\u5f97\u5916\u90e8\u8bbf\u95ee\u6743\u9650\uff0c\u6253\u5f00\u6587\u4ef6 \/etc\/default\/snmpd\u3002<\/p>\n<pre><code>sudo&nbsp;vi&nbsp;\/etc\/default\/snmpd\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u6539\u53d8\u4e0b\u5217\u5185\u5bb9<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u5c06<\/p>\n<pre><code>SNMPDOPTS=<span style=\"color: #d69d85;line-height: 26px\">'-Lsd&nbsp;-Lf&nbsp;\/dev\/null&nbsp;-u&nbsp;snmp&nbsp;-g&nbsp;snmp&nbsp;-I&nbsp;-smux,mteTrigger,mteTriggerConf&nbsp;-p&nbsp;\/var\/run\/snmpd.pid'<\/span>\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u6539\u4e3a<\/p>\n<pre><code>SNMPDOPTS=<span style=\"color: #d69d85;line-height: 26px\">'-Lsd&nbsp;-Lf&nbsp;\/dev\/null&nbsp;-u&nbsp;snmp&nbsp;-I&nbsp;-smux&nbsp;-p&nbsp;\/var\/run\/snmpd.pid&nbsp;-c&nbsp;\/etc\/snmp\/snmpd.conf'<\/span>\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u6700\u540e\u91cd\u542f snmpd<\/p>\n<pre><code>sudo&nbsp;\/etc\/init.d\/snmpd&nbsp;restart\r\n<\/code><\/pre>\n<h4><span style=\"font-size: 16px;color: #f48a00\">\u5b9a\u4e49 SNMPv3 \u7528\u6237\uff0c\u8eab\u4efd\u9a8c\u8bc1\u4ee5\u53ca\u52a0\u5bc6\u53c2\u6570<\/span><\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u201csecurityLevel\u201d\u53c2\u6570\u4f7f\u5f97SNMPv3\u6709\u591a\u79cd\u4e0d\u540c\u7684\u7528\u9014\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u2022noAuthNoPriv \u2014\u2014 \u6ca1\u6709\u6388\u6743\uff0c\u52a0\u5bc6\u4ee5\u53ca\u4efb\u4f55\u5b89\u5168\u4fdd\u62a4\uff01<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u2022authNoPriv \u2014\u2014 \u9700\u8981\u8eab\u4efd\u8ba4\u8bc1\uff0c\u4f46\u662f\u4e0d\u5bf9\u901a\u8fc7\u7f51\u7edc\u53d1\u9001\u7684\u6570\u636e\u8fdb\u884c\u52a0\u5bc6\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u2022autoPriv \u2014\u2014 \u6700\u53ef\u9760\u6a21\u5f0f\u3002\u9700\u8981\u8eab\u4efd\u8ba4\u8bc1\u800c\u4e14\u6570\u636e\u4f1a\u88ab\u52a0\u5bc6\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">snmpd \u7684\u914d\u7f6e\u4ee5\u53ca\u8bbe\u7f6e\u90fd\u4fdd\u5b58\u5728\u6587\u4ef6 \/etc\/snmp\/snmpd.conf\u3002\u4f7f\u7528\u7f16\u8f91\u5668\u7f16\u8f91\u6587\u4ef6\uff1a<\/p>\n<pre><code>sudo&nbsp;vi&nbsp;\/etc\/snmp\/snmpd.conf\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre><code><span style=\"color: #57a64a;font-style: italic;line-height: 26px\">#<\/span>\r\ncreateUser&nbsp;user1\r\ncreateUser&nbsp;user2&nbsp;MD5&nbsp;user2password\r\ncreateUser&nbsp;user3&nbsp;MD5&nbsp;user3password&nbsp;DES&nbsp;user3encryption\r\n<span style=\"color: #57a64a;font-style: italic;line-height: 26px\">#<\/span>\r\nrouser&nbsp;user1&nbsp;noauth&nbsp;1.3.6.1.2.1.1\r\nrouser&nbsp;user2&nbsp;auth&nbsp;1.3.6.1.2.1\r\nrwuser&nbsp;user3&nbsp;priv&nbsp;1.3.6.1.2.1\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u6ce8\uff1a\u5982\u679c\u4f60\u9700\u8981\u4f7f\u7528\u81ea\u5df1\u7684\u7528\u6237\u540d\/\u5bc6\u7801\u5bf9\u7684\u8bdd\uff0c\u8bf7\u6ce8\u610f\u5bc6\u7801\u53ca\u52a0\u5bc6\u77ed\u8bed\u7684\u6700\u5c0f\u957f\u5ea6\u662f8\u4e2a\u5b57\u7b26\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u540c\u65f6\uff0c\u4f60\u9700\u8981\u505a\u5982\u4e0b\u7684\u914d\u7f6e\u4ee5\u4fbfsnmp\u53ef\u4ee5\u76d1\u542c\u6765\u81ea\u4efb\u4f55\u63a5\u53e3\u7684\u8fde\u63a5\u8bf7\u6c42\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u5c06<\/p>\n<pre><code><span style=\"color: #57a64a;font-style: italic;line-height: 26px\">#agentAddress&nbsp;udp:161,udp6:[::1]:161<\/span>\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u6539\u4e3a<\/p>\n<pre><code>agentAddress&nbsp;udp:161,udp6:[::1]:161\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;margin: 5px 0px;line-height: 1.75;letter-spacing: 0.1em;font-size: 16px;text-align: justify\">\u4fdd\u5b58\u6539\u53d8\u540e\u7684snmpd.conf\u6587\u4ef6\u5e76\u4e14\u91cd\u542f\u5b88\u62a4\u8fdb\u7a0b\uff1a<\/p>\n<pre><code>sudo&nbsp;\/etc\/init.d\/snmpd&nbsp;restart\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SNMPv3\u5b9a\u4e49\u4e86\u65b0\u7684\u4f53\u7cfb\u7ed3\u6784\uff0c\u5e76\u5728\u5176\u4e2d\u5305\u542b\u4e86\u5bf9SNMPv1\u548cSNMPv2c\u7684\u517c\u5bb9\uff0c\u5373\u8fd9\u4e2a\u65b0\u7684\u4f53\u7cfb\u7ed3\u6784\u4e5f\u9002\u7528\u4e8e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":22721,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,28],"tags":[],"class_list":["post-22720","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/22720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=22720"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/22720\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/22721"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=22720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=22720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=22720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}