SNMPUSMSection: Net-SNMP (1)Updated: 08 Feb 2002 |
SNMPUSMSection: Net-SNMP (1)Updated: 08 Feb 2002 |
An unauthenticated SNMPv3 user can be created using the command
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.
In order to activate this entry, it is necessary to "clone" an existing user, using the command
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
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 2474). 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(5) manual page for details of the createUser configuration directive.
After cloning a new user entry from the appropriate template, you should immediately change the new user's passphrase.
This command will only change the passphrase of the (SNMPv3) user issuing the command. It is not possible to change the passphrases for other user entries, even given suitable write access.
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
snmpusm -v 3 -u wes -n "" -l authNoPriv -a MD5 -A setup_passphrase localhost passwd setup_passphrase new_passphrase
snmpget -v 3 -u wes -n "" -l authNoPriv -a MD5 -A new_passphrase localhost sysUpTime.0
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.