374
[RouterA] quit
# Establish an SSH connection to SSH server 192.168.1.40.
<RouterA> ssh2 192.168.1.40
Username: client001
Trying 192.168.1.40
Press CTRL+K to abort
Connected to 192.168.1.40...
Enter password:
After you enter the correct username and password, you can log in to Router B successfully.
Publickey authentication enabled Stelnet client configuration
example
Network requirements
As shown in Figure 126, you can log in to Router B through the Stelnet client that runs on Router A.
Router B acts as the Stelnet server, adopting publickey authentication and the DSA public key
algorithm.
Figure 126 Network diagram
Configuration considerations
In the server configuration, the client public key is required. Use the client software to generate a
DSA key pair on the client before configuring the Stelnet server.
Configuration procedure
1. Configure the Stelnet client:
# Configure an IP address for interface Ethernet 1/1.
<RouterA> system-view
[RouterA] interface ethernet 1/1
[RouterA-Ethernet1/1] ip address 192.168.1.56 255.255.255.0
[RouterA-Ethernet1/1] quit
# Generate a DSA key pair.
[RouterA] public-key local create dsa
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...
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++
# Export the DSA public key to file key.pub.
[RouterA] public-key local export dsa ssh2 key.pub
[RouterA] quit