Prerequisite: Stop the snmpd daemon.
/etc/init.d/snmpd stop
-> It is essential that this daemon be stopped to take into account the users!
1 - Edit the general configuration of the snmpd daemon
nano /etc/snmp/snmpd.conf
2 - Add/modify users according to the desired authentication/encryption
#
createUser user1
createUser user2 MD5 user2password
createUser user3 MD5 user3password DES user3encryption
# Specify a particular OID only if you want to restrict user visibility. Leave blank for global access.
rouser user1 noauth 1.3.6.1.2.1.1.1
rouser user2 auth 1.3.6.1.2.1
rwuser user3 priv 1.3.6.1.2.1
3 - Deleting a temporary snmpd file
rm /var/lib/snmp/snmpd.conf
4 - Restart the snmpd daemon
/etc/init.d/snmpd restart
5 - Examples of snmp connections
snmpget -v 3 -u user1 -l NoauthNoPriv cosvgre05 .1.3.6.1.2.1.1.0
snmpget -v 3 -u user2 -l authNoPriv -a MD5 -A user2password cosvgre05 .1.3.6.1.2.1.1.0
snmpget -v 3 -u user3 -l authPriv -a MD5 -A user3password -x DES -X user3encryption cosvgre05 .1.3.6.1.2.1.1.0