beautypg.com

H3C Technologies H3C SecPath F1000-E User Manual

Page 79

background image

23

# Set the authentication mode for the user interfaces to AAA.

[DeviceB] user-interface vty 0 4

[DeviceB-ui-vty0-4] authentication-mode scheme

# Enable the user interfaces to support SSH.

[DeviceB-ui-vty0-4] protocol inbound ssh

# Set the user command privilege level to 3.

[DeviceB-ui-vty0-4] user privilege level 3

[DeviceB-ui-vty0-4] quit

# Import the peer public key from the file key.pub.

[DeviceB] public-key peer Device001 import sshkey key.pub

# Specify the authentication method for user client002 as publickey, and assign the public key
Device001 to the user.

[DeviceB] ssh user client002 service-type stelnet authentication-type publickey assign

publickey Device001

Step3

Establish a connection between the SSH client and the SSH server

# Establish an SSH connection to the server (10.165.87.136).

ssh2 10.165.87.136

Username: client002

Trying 10.165.87.136 ...

Press CTRL+K to abort

Connected to 10.165.87.136 ...

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 into Device B successfully.