snmpuserconfig

Last Updated : Mar 21, 2024 |

Syntax:

Use the snmpuserconfig command to configure SNMP users. You can add, modify, or delete a user.

  • For SNMP v1 and SNMP v2:

    snmpuserconfig -v 1|2 -r|-w --if <ipaddr or fqdn> [--old_ipaddrfqdn <ipaddr or fqdn>] -c<comm_name> [-o <comm_name>] --add | --delete | --change

where,

--if: IP address or fqdn of the polling system or '0.0.0.0' for IPV4 Any

-i: IP address or fqdn of the polling system or '0.0.0.0' for IPV4 Any. Valid IP addresses or '::' for ipV6 Any Valid IP addresses.

--old_ipaddrfqdn: previous destination fqdn or IP address (Only valid with Change option or required when changing the destination for an entry.)

-w: Read-write access

-d: Enter 'enable' or 'disable' for LSP dcedge tunneling

-i: Destination IP address

--old_ipaddr: Previous destination IP address

-c: v1/v2c community name

-o: Previous community name

--add: Add user

--delete: Delete user

--change: Modify user

  • For SNMP v3:

    snmpuserconfig -v 3 -r|-w -u <user> [-o <user>] [-sauthNoPriv | authPriv] [-a <auth_passwd>] [--auth_prot<protocol>][-p <priv_passwd>] [--priv_prot <protocol>] --add | --delete | --change
    snmpuserconfig --help | -h

where,

-v: SNMP version (1, 2, 3)

-r: Read-only entry

-w: Read/write access

-u: v3 user name

-o: Previous community/user name (only valid with the change option, required when changing the user/community name.)

-s: v3 security model (authNoPriv, authPriv)

-a: v3 authentication password

--auth_prot: Authentication protocol

-p: v3 privacy password

--priv_prot: v3 privacy protocol (none, DES, AES128)

--add: Add user

--delete: Delete user

--change: Modify user

--auth_list: List supported authentication protocols

--priv_list: List supported privacy protocols

--rclist: List possible return codes from this command

--rccode: Obtain error string associated with a return code

--help | -h: Usage (this)

DEFAULT: snmpuserconfig called with no arguments will display the current configuration.

Note:

Using the -a and -p options with arguments on the command line poses a security risk as the passwords may be logged. Instead, use the -a and -p options without arguments to prevent the risk.

Example:

  • Version 1:

snmpuserconfig -v 1 -r -i 135.9.36.44 -c public--add
snmpuserconfig -v 1 -r -i 135.9.36.43 --old_ipaddr135.9.36.44-c private-o public --change
snmpuserconfig -v 1 -r -i 135.9.36.43 -c private --delete
  • Version 2:

snmpuserconfig -v 2 -w -i 135.9.36.44 -cpublic--add
snmpuserconfig -v 2 –r -i 135.9.36.43 --old_ipaddr135.9.36.44-cprivate -opublic --change
snmpuserconfig -v 2 -w -i 135.9.36.43 -c private--delete
  • Version 3:

snmpuserconfig -v3 -w -u user1 -sauthPriv-aauthpasswd--auth_protMD5-pprivpasswd-p--priv_protDES --add
snmpuserconfig -v3 -w -u username -ouser1-sauthPriv-aauthpasswd--auth_protMD5-pprivpasswd--priv_protDES--change
snmpuserconfig -v3 -w -u user1 --delete