1.添加加密方式直接版,直接写入snmpd.conf
rouser read123
createUser read123 SHA sha12345 AES admin12345
rwuser write123
createUser write123 SHA sha12345 AES admin12345
2.使用命令
2.1添加只读用户
ubuntu@ubuntu:/usr/local/net-snmp/bin$ sudo ./net-snmp-create-v3-user -ro -A md51234 -X read12346 -a MD5 -x DES read3
adding the following line to /var/net-snmp/snmpd.conf:
createUser read3 MD5 "md51234" DES "read12346"
adding the following line to /snmp/snmpd.conf:
rouser read3
touch: cannot touch '/snmp/snmpd.conf': No such file or directory
./net-snmp-create-v3-user: line 146: /snmp/snmpd.conf: No such file or directory
ubuntu@ubuntu:/usr/local/net-snmp/bin$
在snmpd.conf 里面添加 rouser read3
2.2添加读写用户
ubuntu@ubuntu:/usr/local/net-snmp/bin$ sudo ./net-snmp-create-v3-user -A md512346 -X write12346 -a MD5 -x DES write3
adding the following line to /var/net-snmp/snmpd.conf:
createUser write3 MD5 "md512346" DES "write12346"
adding the following line to /snmp/snmpd.conf:
rwuser write3
touch: cannot touch '/snmp/snmpd.conf': No such file or directory
./net-snmp-create-v3-user: line 146: /snmp/snmpd.conf: No such file or directory
ubuntu@ubuntu:/usr/local/net-snmp/bin$
在snmpd.conf 里面添加 rwuser write3
注意:
新的机器脚本里面添加V3用户名等的配置后,需要生成新的引擎ID,
具体的方法是删掉/var目录下的snmpd.conf就可以了
否则容易造成引擎ID重复造成的冲突,在MIBBROWSER等V3需要验证引擎ID的场合(这个软件V3需要验证引擎ID)会出现组网机箱有的机箱会连接不上SNMPD,或者时断时续的问题