snmpusm [COMMON_OPTIONS] AGENT delete USER
snmpusm [COMMON_OPTIONS] AGENT cloneFrom USER CLONEFROM-USER
The snmpusm utility is an SNMP application that can be used to do simple maintenance on a SNMP agent's User-based Security Module (USM) table. You can create, delete, clone, and change the passphrase of users configured on a running SNMP agent.
Common options for all snmpusm commands:
Set usmUserEngineID to be used as part of the index of the usmUserTable. Default is to use the contextEngineID (set via
-Eor probed) as the usmUserEngineID. -CpSRING
Set the usmUserPublic value of the (new) user to the specified STRING.
Options for the passwd and changekey commands:
Change the authentication key.
Change the privacy key.
Allows one to use localized key (must start with 0x) instead of passphrase. When this option is used, either the
-Caor -Cxoption (but not both) must also be used.
An unauthenticated SNMPv3 user can be created using the command
snmpusm [COMMON OPTIONS] AGENT create USER
This constructs an (inactive) entry in the usmUserTable, with no
authentication or privacy settings. In principle, this user should be
useable for 'noAuthNoPriv' requests, but in practise the Net-SNMP agent
will not allow such an entry to be made active. The user can be
created via the createAndWait operation instead by using the
In order to activate this entry, it is necessary to "clone" an existing user, using the command
snmpusm [COMMON OPTIONS] AGENT cloneFrom USER CLONEFROM-USER
The USER entry then inherits the same authentication and privacy settings (including pass phrases) as the CLONEFROM user.
These two steps can be combined into one, by using the command
snmpusm [COMMON OPTIONS] AGENT create USER CLONEFROM-USER
The two forms of the create sub-command require that the user being created does not already exist. The cloneFrom sub-command requires that the user being cloned to does already exist.
Cloning is the only way to specify which authentication and privacy protocols to use for a given user, and it is only possible to do this once. Subsequent attempts to reclone onto the same user will appear to succeed, but will be silently ignored. This (somewhat unexpected) behaviour is mandated by the SNMPv3 USM specifications (RFC 3414). To change the authentication and privacy settings for a given user, it is necessary to delete and recreate the user entry. This is not necessary for simply changing the pass phrases (see below). This means that the agent must be initialized with at least one user for each combination of authentication and privacy protocols. See the snmpd.conf manual page for details of the createUser configuration directive.
A user can be deleted from the usmUserTable using the command
snmpusm [COMMON OPTIONS] AGENT delete USER
User profiles contain private keys that are never transmitted over the wire in clear text (regardless of whether the administration requests are encrypted or not). To change the secret key for a user, it is necessary to specify the user's old passphrase as well as the new one. This uses the command:
snmpusm [COMMON OPTIONS] [-Ca] [-Cx] AGENT passwd OLD-PASSPHRASE NEW-PASSPHRASE [USER]
After cloning a new user entry from the appropriate template, you should immediately change the new user's passphrase.
If USER is not specified, this command will change the passphrase of
the (SNMPv3) user issuing the command. If the
snmpusm [COMMON OPTIONS] [-Ca] [-Cx] AGENT changekey [USER]
This command changes the key in a perfect-forward-secrecy compliant way through a diffie-helman exchange. The remote agent must support the SNMP-USM-DH-OBJECTS-MIB for this command to work. The resulting keys are printed to the console and may be then set in future command invocations using the --defAuthLocalizedKey and --defPrivLocalizedKey options or in your snmp.conf file using the defAuthLocalizedKey and defPrivLocalizedKey keywords.
Note that since these keys are randomly generated based on a diffie helman exchange, they are no longer derived from a more easily typed password. They are, however, much more secure.
To change from a localized key back to a password, the following variant of the passwd sub-command is used:
snmpusm [COMMON OPTIONS] <-Ca | -Cx> -Ck AGENT passwd OLD-KEY-OR-PASSPHRASE NEW-KEY-OR-PASSPHRASE [USER]
Note that snmpusm REQUIRES an argument specifying the agent to query as described in the snmpcmd manual page.
Let's assume for our examples that the following VACM and USM configurations lines were in the snmpd.conf file for a Net-SNMP agent. These lines set up a default user called initial with the authentication passphrase setup_passphrase so that we can perform the initial setup of an agent:
# VACM configuration entries rwuser initial # lets add the new user we'll create too: rwuser wes # USM configuration entries createUser initial MD5 setup_passphrase DES
Note: the initial user's setup should be removed after creating a real user that you grant administrative privileges to (like the user wes we'll be creating in this example.
Note: passphrases must be 8 characters minimum in length.
snmpusm -v3 -u initial -n "" -l authNoPriv -a MD5 -A setup_passphrase localhost create wes initial
Creates a new user, here named wes using the user initial to do it. wes is cloned from initial in the process, so he inherits that user's passphrase (setup_passphrase).
snmpusm -v 3 -u wes -n "" -l authNoPriv -a MD5 -A setup_passphrase localhost passwd setup_passphrase new_passphrase
After creating the user wes with the same passphrase as the initial user, we need to change his passphrase for him. The above command changes it from setup_passphrase, which was inherited from the initial user, to new_passphrase.
snmpget -v 3 -u wes -n "" -l authNoPriv -a MD5 -A new_passphrase localhost sysUpTime.0
If the above commands were successful, this command should have properly performed an authenticated SNMPv3 GET request to the agent.
Now, go remove the vacm "group" snmpd.conf entry for the initial user and you have a valid user wes that you can use for future transactions instead of initial.
All UNIX systems. Windows Server 2012. Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019.
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
- File Formats:
PTC MKS Toolkit 10.3 Documentation Build 39.