326
[RouterA-pkey-key-code]E1E570A3F6B1C2411948B3B4FFA256699B3BF871221CC9C5D
F257523777D033BEE77FC378145F2AD
[RouterA-pkey-key-code]D716D7DB9FCABB4ADBF6FB4FDB0CA25C761B308EF53009F71
01F7C62621216D5A572C379A32AC290
[RouterA-pkey-key-code]E55B394A217DA38B65B77F0185C8DB8095522D1EF044B465E
8716261214A5A3B493E866991113B2D
[RouterA-pkey-key-code]485348
[RouterA-pkey-key-code] public-key-code end
[RouterA-pkey-public-key] peer-public-key end
# Specify the host public key for the SSH server (10.165.87.136) as
key1
.
[RouterA] ssh client authentication server 10.165.87.136 assign publickey key1
[RouterA] quit
# Establish an SSH connection to SSH server 10.165.87.136.
<RouterA> ssh2 10.165.87.136
Username: client001
Trying 10.165.87.136
Press CTRL+K to abort
Connected to 10.165.87.136...
Enter password:
After you enter the correct username and password, log in to Router B successfully.
Configuring router to act as public key authentication client
Network requirements
, Router A (the SSH client) must pass publickey authentication to log in to Router
B (the SSH server) through the SSH protocol. Use the DSA public key algorithm.
Figure 115
Router acts as client for publickey authentication
During SSH server configuration, the client public key is required. Use the client software to generate a
DSA key pair on the client before configuring the SSH server.
Configuration procedure
1.
Configure the SSH client.
# Configure an IP address for interface GigabitEthernet 1/0/1.
<RouterA> system-view
[RouterA] interface GigabitEthernet 1/0/1
[RouterA-GigabitEthernet1/0/1] ip address 10.165.87.137 255.255.255.0
[RouterA-GigabitEthernet1/0/1] quit