I just had a similar issue. I had added an user, and wanted to delete it again. However, net-snmp removes the createUser
statements from the /var/net-snmp/snmpd.conf file for security reasons, thus Ashwin kumar's answer did not work for me (* see EDIT below).
snmpusm
has a delete
option, which can be used to remove users. snmpusm
requires another user to authenticate the delete
request (I haven't tested without, but I would assume that the other user has to have RW access). The following example has enabled me to remove a user from my snmp configuration:
snmpusm -v 3 -u <RWUSER> -l authNoPriv -a MD5 -A <PASSWORD_OF_RWUSER> localhost delete <USERNAME_TO_DELETE>
This solution is inspired by this page http://www.mkssoftware.com/docs/man1/snmpusm.1.asp which also describes how to create a user and change the Passphrase of a user with snmpusm
.
EDIT: My bad, I didn't notice that the /var/net-snmp/snmpd.conf actually contained more lines than what vim displayed without scrolling. The "usmUser" lines that Ashwin mentions are there. I haven't tried to remove the lines, but I assume that would work as well.