Steps to configure SNMPv3
1. Install the required packages
Install the 2 required packages namely,
1. net-snmp-utils
2. net-snmp-devel
# yum install net-snmp net-snmp-utils net-snmp-devel
net-snmp-utils is required to use the utility snmpwalk.
2. Configure SNMP version 3 user
We need to turn off the agent when running net-snmp-create-v3-user command.
# service snmpd stop
There are 3 ways you can create the user.
1. command line
2. Interactive
3. Manually
1. Command line
The syntax of –create-snmp3-user is as below :
--create-snmpv3-user [-ro] [-A authpass] [-X privpass] [-a MD5|SHA] [-x DES|AES] [username]
Default authentication method is MD5 and default encryption is DES if not explicitly specified.
# net-snmp-config --create-snmpv3-user -a MD5 -A geek123 geekuser
2. Interactive
You can also use interactive mode to enter username and password as follows :
# net-snmp-create-v3-user Enter a SNMPv3 user name to create: geekuser Enter authentication pass-phrase: geek123 Enter encryption pass-phrase: [press return to reuse the authentication pass-phrase] adding the following line to /var/lib/net-snmp/snmpd.conf: createUser geekuser MD5 "geek123" DES adding the following line to /etc/snmp/snmpd.conf: rwuser geekuser
3. Manual
To manually add the user – add below line to the file /var/lib/net-snmp/snmpd.conf :
createUser geekuser MD5 "geek123" DES
and add below lines to the file /etc/snmp/snmpd.conf
rwuser geekuser
The sample username is geekuser and pass-phrase is geek123.
3. Start the service
Use chkconfig command to configure the SNMP services to start on each reboot :
# chkconfig snmpd on
Start the snmpd service :
# service snmpd start
4. Test the setup using snmpwalk command
# snmpwalk -v3 -u geekuser -l authNoPriv -a MD5 -A geek123 localhost
Here,
-v3 - specifies version -u - specifies username -l - specifies security level -a - specifies Authentication Protocol -A - specifies Pass-phrase