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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. swapon: command not found
  2. autossh: Run, monitor and restart SSH connections
  3. “git stage” Command Examples
  4. createrepo: command not found
  5. sa Command Examples in Linux
  6. rpm-ostree Command Examples in Linux
  7. How to Create and Manage Storage Domains in RedHat Virtualization (RHV)
  8. Linux “rm” Command Examples
  9. How to Disable IPv6 in CentOS/RHEL 8
  10. balena Command Examples (Interact with the balenaCloud, openBalena and the balena API from the command-line)

You May Also Like

Primary Sidebar

Recent Posts

  • “glab pipeline” Command Examples
  • “glab mr” Command Examples
  • “glab mr merge” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright