SNMPUSM(1)
okay bestie, sit down, hydrate, because today we're learning snmpusm β aka SNMPUSM(1), straight from the Net-SNMP girlies. it makes and maintains SNMPv3 users on a network entity and honestly? it's giving sysadmin main character energy. π
β¨ NAME β¨
snmpusm β makes and maintains SNMPv3 users on a network entity π§
πΈ SYNOPSIS πΈ
snmpusm [COMMON OPTIONS] [-Cw] AGENT create USER [CLONEFROM-USER]
snmpusm [COMMON OPTIONS] AGENT delete USER
snmpusm [COMMON OPTIONS] AGENT cloneFrom USER CLONEFROM-USER
snmpusm [COMMON OPTIONS] [-Ca] [-Cx] AGENT passwd OLD-PASSPHRASE NEW-PASSPHRASE [USER]
snmpusm [COMMON OPTIONS] <-Ca | -Cx> -Ck AGENT passwd OLD-KEY-OR-PASSPHRASE NEW-KEY-OR-PASSPHRASE [USER]
snmpusm [COMMON OPTIONS] [-Ca] [-Cx] AGENT changekey [USER]
π DESCRIPTION π
so basically snmpusm is an SNMP app that does lil' glow-up maintenance on the users your SNMP agent already knows about, by messing with the agent's User-based Security Module (USM) table. π¦
heads up though β the user you're acting as needs write access to the usmUserTable MIB table. no write access, no slay. π
what can it do? create, delete, clone, and change the passphrase of users configured on a running SNMP agent. it's the whole package fr fr. π
π OPTIONS π
the ones everybody gets
-CE ENGINE-IDβ setsusmUserEngineIDso it gets used as part of the index of theusmUserTable. the default is to take thecontextEngineID(set via-Eor probed) and use that as theusmUserEngineID. yes that's a lot of engineIDs, no we're not okay. π-Cp STRINGβ sets theusmUserPublicvalue of the (new) user to the STRING you hand over. cute lil' public label, adore. π
the ones that only passwd and changekey get to use
-Caβ change the authentication key.-Cxβ change the privacy key.-Ckβ lets you use a localized key instead of a passphrase β and it must start with0x. β οΈ when you use this one, you also have to use either-Caor-Cxβ but not both. both is not the vibe.
π CREATING USERS π
an unauthenticated SNMPv3 user can be created with:
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. so close bestie. π
instead you can create the user via the createAndWait operation using the -Cw flag. that keeps the user from being marked as active in any agent until you explicitly activate it later with the activate command. patience, queen. β
to activate this entry, you have to "clone" an existing user, like this:
snmpusm [COMMON OPTIONS] AGENT cloneFrom USER CLONEFROM-USER
and the USER entry then inherits the same authentication and privacy settings (including pass phrases!!) as the CLONEFROM user. passing down the genes fr. π§¬
these two steps can be combined into one, using:
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. know the difference, it matters. π
cloning is the only way to specify which authentication and privacy protocols to use for a given user, and it's 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, you have to delete and recreate the user entry. that's not necessary for simply changing the pass phrases (see below). this means the agent must be initialized with at least one user for each combination of authentication and privacy protocols. see thesnmpd.conf(5)manual page for details of thecreateUserconfiguration directive. periodt.
ποΈ DELETING USERS ποΈ
bye bye bestie. a user can be deleted from the usmUserTable using:
snmpusm [COMMON OPTIONS] AGENT delete USER
π CHANGING PASS PHRASES π
user profiles contain private keys that are never transmitted over the wire in clear text (no matter whether the administration requests are encrypted or not). so to change the secret key for a user, you have to give the user's old passphrase as well as the new one. like this:
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. immediately immediately. π«Ά
if USER is not specified, this command will change the passphrase of the (SNMPv3) user issuing the command. if the -Ca or -Cx options are specified, then only the authentication or privacy keys are changed. if these options are not specified, then both the authentication and privacy keys are changed.
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, no cap. π₯
the resulting keys are printed to the console and may then be 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. trade-off queen. β¨
to change from a localized key back to a password, use this variant of the passwd sub-command:
snmpusm [COMMON OPTIONS] <-Ca | -Cx> -Ck AGENT passwd OLD-KEY-OR-PASSPHRASE NEW-KEY-OR-PASSPHRASE [USER]
either the -Ca or the -Cx option must be specified. the OLD-KEY-OR-PASSPHRASE and/or NEW-KEY-OR-PASSPHRASE arguments can either be a passphrase or a localized key starting with "0x", e.g. as printed out by the changekey sub-command.
note thatsnmpusmREQUIRES an argument specifying the agent to query, as described in thesnmpcmd(1)manual page. no agent, no service. π
π EXAMPLES π
let's pretend, 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 we can do 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. yes, minimum. don't try it. π
π Create a new user
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"). new user, who dis. π
π Change the user's 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". glow up complete. β¨
π Test the new user
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. slay. π₯
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. (the quotes there are the manpage's, iykyk.) π
β οΈ WARNING β οΈ
manipulating the usmUserTable using this command can only be done using SNMPv3. this command will not work with the community-based versions, even if they have write access to the table. don't try to make fetch happen, it is not going to happen. π
π¦ SEE ALSO π¦
snmpd.conf(5), snmp.conf(5), RFC 3414
and that's the whole page bestie π«Ά this was Net-SNMP version V5.9.5.2, dated 11 Dec 2009. iconic of them. mwah π
π¦ where this page comes from
- alpine 3.23: net-snmp-doc 5.9.5.2-r0 Β· Net-SNMP
- alpine 3.24: net-snmp-doc 5.9.5.2-r0 Β· Net-SNMP
- arch rolling: net-snmp 5.9.5.2-2 Β· BSD
- nixos 26.05: net-snmp 5.9.5.2
- nixpkgs unstable: net-snmp 5.9.5.2
- ubuntu stonking: snmp 5.9.5.2+dfsg-2.1ubuntu5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms