H3C Technologies H3C SecBlade LB Cards User Manual
Page 193
182
[Router] public-key local create rsa
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Press CTRL+C to abort.
Input the bits of the modulus[default = 1024]:
Generating Keys...
++++++++
++++++++++++++
+++++
++++++++
# Enable SSH server function.
[Router] ssh server enable
# Configure an IP address for interface GigabitEthernet 0/1. The Stelnet client uses this IP address
as the destination address for SSH connection.
[Router] interface gigabitethernet 0/1
[Router-GigabitEthernet0/1] ip address 192.168.1.40 255.255.255.0
[Router-GigabitEthernet0/1] quit
# Set the authentication mode for the user interface to AAA.
[Router] user-interface vty 0 4
[Router-ui-vty0-4] authentication-mode scheme
# Enable the user interface to support SSH.
[Router-ui-vty0-4] protocol inbound ssh
# Set the user command privilege level to 3.
[Router-ui-vty0-4] user privilege level 3
[Router-ui-vty0-4] quit
# Import the peer public key from the file key.pub, and name it ClientKey.
[Router] public-key peer ClientKey import sshkey key.pub
# Specify the authentication method for the user client002 as publickey, and assign the public key
ClientKey to the user.
[Router] ssh user client002 service-type stelnet authentication-type publickey assign
publickey ClientKey
3.
Establish a connection to the Stelnet server:
# Establish an SSH connection to the Stelnet server 192.168.1.40.
Username: client002
Trying 192.168.1.40 ...
Press CTRL+K to abort
Connected to 192.168.1.40 ...
The Server is not authenticated. Continue? [Y/N]:y
Do you want to save the server public key? [Y/N]:n
Then, you can log in to the router successfully.