Examples
The following example shows how to configure the privilege level that
the user need to assign:
switch(config)# username admin priv-lvl 13
switch(config)#
The following example shows how to generate SSH keys:
switch(config)# username admin keypair generate rsa force
generating rsa key(1024 bits).....
.generated rsa key
switch(config)#
The following example shows how to delete SSH keys:
switch(config)# no username admin keypair generate rsa force
generating rsa key(1024 bits).....
.generated rsa key
switch(config)#
The following example shows how to export a keypair to bootflash or
to the volatile directory:
switch(config)# username admin keypair export bootflash:xyz rsa force
Enter Passphrase:
switchg(config)#
The user can configure the same set of SSH keypairs on different
switches by copying the public and private keypair to that switch and importing
them using the following commands.
The following example shows how to import keypair from bootflash or
volatile directory:
switch(config)# username admin keypair import bootflash:xyz rsa force
Enter Passphrase:
switchg(config)#
The following example shows how to define a user:
switch(config)# username knuckles password testpw role bodega
switch(config)# do show user-account
user:admin
this user account has no expiry date
roles:network-admin
user:knuckles
this user account has no expiry date
roles:bodega
The following example configures the name for a user to log in using
iSCSI authentication:
switch(config)# username iscsi
The following example places you in the mode for the specified role
(techdocs). The prompt indicates that you are now in the role configuration
submode. This submode is now specific to the techdocs group.
switch(config)# username role name techdocs
switch(config-role)#
The following example deletes the role called techdocs:
switch(config)# no username role name techdocs
The following example assigns a description to the new role. The
description is limited to one line and can contain spaces:
switch(config-role)# description Entire Tech. Docs. group
The following example resets the description for the Tech. Docs.
group:
switch(config-role)# no description
The following example creates or updates the user account (usam)
along with a password (abcd) that is set to expire on 2009-05-31:
switch(config)# username usam password abcd expire 2009-05-31
The following example creates or updates the user account (msam)
along with a password (abcd) specified in clear text (indicated by 0):
switch(config)# username msam password 0 abcd role network-operator
The following example specifies an encrypted (specified by 5)
password (!@*asdsfsdfjh!@df) for the user account (user1):
switch(config)# username user1 password 5!@*asdsfsdfjh!@df
The following example adds the specified user (usam) to the
network-admin role:
switch(config)# username usam role network-admin
The following example deletes the specified user (usam) from the
vsan-admin role:
switch(config)# no username usam role vsan-admin
The following example shows how to define a distinguished name on a
switch for SSH certificate authentication:
switch# config t
switch(config)# username knuckles ssh-cert-dn /CN=excal-1.cisco.com rsa
switch(config)# do show user-account
user:admin
this user account has no expiry date
roles:network-admin
user:knuckles
this user account has no expiry date
roles:network-operator
ssh cert DN : /CN=excal-1.cisco.com; Algo: x509v3-sign-rsa
The following example specifies the SSH X.509 certificate
distinguished name and DSA algorithm for an existing user account (usam):
switch(config)# username usam ssh-cert-dn usam-dn dsa
The following example specifies the SSH X.509 certificate
distinguished name and RSA algorithm for an existing user account:
switch(config)# username user1 ssh-cert-dn user1-dn rsa
The following example deletes the SSH X.509 certificate distinguished
name for the user account:
switch(config)# no username admin ssh-cert-dnadmin-dn dsa
The following example identifies the contents of the SSH key for the
specified user (usam):
switch(config)# username usam sshkey fsafsd2344234234ffgsdfg
The following example deletes the SSH key content identification for
the user (usam):
switch(config)# no username usam sshkey fsafsd2344234234ffgsdfgffsdfsfsfssf
The following example updates the SNMPv3 password for the specified
user (joe). The local CLI password and the SNMP password are updated. If user
Joe does not exist, the command fails:
switch(config)# username joe password wxyz6789 update-snmpv3 abcd1234