Adding Users with NET_SNMP

1. Create GroupA and add a new users anna and dave to GroupA. GroupA is going to be an authenticated, non-encrypted group.

C:\usr>snmpvacm  -v 3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 createSec2Group 3 anna groupA
Sec2group successfully created.

C:\usr>snmpvacm  -v 3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 createSec2Group 3 dave groupA
Sec2group successfully created.


2. Create GroupN and add a new users jim and tom to GroupN. GroupN is going to be a full access group.

C:\usr>snmpvacm  -v 3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 createSec2Group 3 tom groupN
Sec2group successfully created.

C:\usr>snmpvacm  -v 3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 createSec2Group 3 jim groupN
Sec2group successfully created.


3. Create all MIB view all. There is allmib view, this is just to demonstrate the command.

C:\usr>snmpvacm -v 3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 createView all .1 80
View successfully created.


4. Create an authenticated access (2) for a groupA in allmib view.

C:\usr>snmpvacm -v 3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 createAccess  groupA 3 2 1 allmib allmib none
Access successfully created.


5. Create a full access (2) for a groupN in all view.

C:\usr>snmpvacm -v 3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 createAccess  groupN 3 1 1 all all none
Access successfully created.

6. Add users dave, anna, jim, and tom. Change their passwords.

C:\usr>snmpusm -v3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 create dave secureUser
User successfully created.

C:\usr>snmpusm -v3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key -Ca 10.52.32.121 passwd auth_key daves_key dave
SNMPv3 Key(s) successfully changed.

C:\usr>snmpusm -v3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 create anna secureUser
User successfully created.

C:\usr>snmpusm -v3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key -Ca 10.52.32.121 passwd auth_key annas_key anna
SNMPv3 Key(s) successfully changed.

C:\usr>snmpusm -v3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 create jim secureUser
User successfully created.

C:\usr>snmpusm -v3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key -Ca 10.52.32.121 passwd auth_key jims_key jim
SNMPv3 Key(s) successfully changed.

C:\usr>snmpusm -v3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 create tom secureUser
User successfully created.

C:\usr>snmpusm -v3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key -Ca 10.52.32.121 passwd auth_key toms_key tom
SNMPv3 Key(s) successfully changed.


7. Test authenticated access for all users.

C:\usr>snmpget -v 3 -u dave -n "" -l authNoPriv -a MD5 -A daves_key 10.52.32.121 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (48523) 0:08:05.23

C:\usr>snmpget -v 3 -u anna -n "" -l authNoPriv -a MD5 -A annas_key 10.52.32.121 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (50012) 0:08:20.12

C:\usr>snmpget -v 3 -u tom -n "" -l authNoPriv -a MD5 -A toms_key 10.52.32.121 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (51680) 0:08:36.80

C:\usr>snmpget -v 3 -u jim -n "" -l authNoPriv -a MD5 -A jims_key 10.52.32.121 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (53158) 0:08:51.58

C:\usr>snmpget -v 3 -u secureUser -n "" -l authNoPriv -a MD5 -A auth_key 10.52.32.121 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (56002) 0:09:20.02

7. Test unauthenticated access for different users. It will work only for jim and tom.

C:\usr>snmpget -v 3 -u jim -n "" -l noAuthNoPriv 10.52.32.121 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (58677) 0:09:46.77

C:\usr>snmpget -v 3 -u tom -n "" -l noAuthNoPriv 10.52.32.121 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (59631) 0:09:56.31

C:\usr>snmpget -v 3 -u anna -n "" -l noAuthNoPriv 10.52.32.121 sysUpTime.0
Error in packet
Reason: noAccess
Failed object: DISMAN-EVENT-MIB::sysUpTimeInstance

C:\usr>snmpget -v 3 -u dave -n "" -l noAuthNoPriv 10.52.32.121 sysUpTime.0
Error in packet
Reason: noAccess
Failed object: DISMAN-EVENT-MIB::sysUpTimeInstance


8. Dave will delete user entry for tom. Test that tom is deleted.

C:\usr>snmpusm -v3 -u dave -n "" -l authNoPriv -a MD5 -A daves_key 10.52.32.121 delete tom
User successfully deleted.

C:\usr>snmpget -v 3 -u tom -n "" -l noAuthNoPriv 10.52.32.121 sysUpTime.0
snmpget: Unknown user 
