Generating the RSA key pair on the server is prerequisite to SSH login.
# Generate RSA key pair.
[SwitchB] public-key local create rsa
# Set AAA authentication on user interfaces.
[SwitchB] user-interface vty 0 4
[SwitchB-ui-vty0-4] authentication-mode scheme
# Configure the user interfaces to support SSH.
[SwitchB-ui-vty0-4] protocol inbound ssh
# Set the user command privilege level to 3.
[SwitchB-ui-vty0-4] user privilege level 3
[SwitchB-ui-vty0-4] quit
# Specify the authentication type for user client001 as publickey.
[SwitchB] ssh user client001 authentication-type publickey
Before doing the following steps, you must first generate a RSA key pair on the client and save the key
pair in a file named Switch001, and then upload the file to the SSH server through FTP or TFTP. For
details, refer to the following “Configure Switch A”.
# Import the client’s public key file Switch001 and name the public key as Switch001.
[SwitchB] public-key peer Switch001 import sshkey Switch001
# Assign public key Switch001 to user client001
[SwitchB] ssh user client001 assign publickey Switch001
# Export the generated RSA host public key pair to a file named Switch002.
[SwitchB] public-key local export rsa ssh2 Switch002
When first-time authentication is not supported, you must first generate a RSA key pair on the server
and save the key pair in a file named Switch002, and then upload the file to the SSH client through FTP
or TFTP.
z
Configure Switch A