• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 6 : Install and Configure SNMPv3

by admin

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
CentOS / RHEL : How to determine which SNMP version is being used

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Read Audit Log in Linux
  2. nsenter: command not found
  3. CentOS / RHEL 7 : How to install and configure telnet
  4. Linux / UNIX : How to find files which has SUID/SGID set
  5. aa-complain: command not found
  6. partx Command Examples in Linux
  7. Ubuntu: Changing the stripe size of a striped LVM volume
  8. Which network ports are reserved by the Linux Operating System?
  9. adig Command Examples in Linux
  10. SSHFS (Secure SHell FileSystem) – Securely Mount remote filesystem over ssh

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright