U Commands
username
If you do not specify a password for the user account, the user might not be able to log in to the account.
Caution
To use this command, you must enable the cumulative privilege of roles using the feature privilege command.
A passphrase is required when you export or import the key-pair. The passphrase encrypts the exported private
key for the user and decrypts it during import.
This command does not require a license.
Examples
This example shows how to create a user account with a password and a user role:
switch# configure t
switch(config)# username user1 password Ci5co321 role vdc-admin
This example shows how to configure the SSH key for a user account:
switch# configure t
switch(config)# username user1 sshkey file bootflash:key_file
This example shows how to generate the SSH public and private keys and store them in the home directory
of the Cisco NX-OS device for the user:
switch# configure t
switch(config)# username user1 keypair generate rsa
generating rsa key(2048 bits)......
generated rsa key
This example shows how to export the public and private keys from the home directory of the Cisco NX-OS
device to the bootflash directory:
switch# configure t
switch(config)# username user1 keypair export bootflash:key_rsa rsa
Enter Passphrase:
switch(config)# dir
.
.
.
951 Jul 09 11:13:59 2009 key_rsa
221 Jul 09 11:14:00 2009 key_rsa.pub
.
.
The private key is exported as the file that you specify, and the public key is exported with the same filename
followed by a .pub extension.
This example shows how to import the exported public and private keys from the bootflash directory to the
home directory of the Cisco NX-OS device:
switch# configure t
switch(config)# username user1 keypair import bootflash:key_rsa rsa
Enter Passphrase:
switch(config)# show username user1 keypair
**************************************
rsa Keys generated: Thu Jul 9 11:10:29 2009
ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAIEAxWmjJT+oQhIcvnrMbx2BmD0P8boZElTfJ
Fx9fexWp6rOiztlwODtehnjadWc6A+DE2DvYNvqsrU9TBypYDPQkR/+Y6cKubyFW
VxSBG/NHztQc3+QC1zdkIxGNJbEHyFoajzNEO8LLOVFIMCZ2Td7gxUGRZc+fbq
S33GZsCAX6v0=
bitcount:262144
fingerprint:
8d:44:ee:6c:ca:0b:44:95:36:d0:7d:f2:b5:78:74:7d
**************************************
could not retrieve dsa key information
Cisco Nexus 7000 Series Security Command Reference
973