5.交换机作为SSH客户端登录出错

提示服务器的主机密钥与本地缓存的密钥不匹配。 服务器管理员更改了主机密钥,或者您连接到另一台服务器伪装成该服务器。 请在登录前删除本地缓存的密钥!

使用华三交换机作为ssh客户端登录其他设备,报错如下,提示设备本地保存的密钥和对方返回的密钥不同,

<H3C> ssh 192.168.1.1
Username: admin
Press CTRL+C to abort.
Connecting to 192.168.1.1 port 22.
The server's host key does not match the local cached key. Either the server administrator has changed the host key, or you connected to another server pretending to be this server. Please remove the local cached key, before logging in!

1.查看本地保存到密钥

[H3C]display ssh client server-public-key 
 Server address: 192.168.1.1
 Key type: rsa
 Key length: 1024
 Key code:
   AAAAB3SDEFASe2^&^FSPODSNAAAgQDPyZwexaYdGOk0U9npokGQcA3gdPj7dTkL
   cruATInJMq46NWh0BHsdsdfdsgdT&K@F(EDADSFAFDIY+zRN+8mZt2x6fOIP3r
   uZUHcow74L3IdJLnFjLK9hDX2iG0TZC17+1C1qHQHN2lCX5dhnFVhSGdxrjK9Z0j
   4EXhXjQ4ww==

2.删除本地保存的密钥

[H3C]delete ssh client server-public-key server-ip 192.168.1.1

3.重新登录,提示是否保存密钥,输入密码登录成功

<H3C>ssh 192.168.1.1
Username: admin
Press CTRL+C to abort.
Connecting to 192.168.1.1 port 22.
The server is not authenticated. Continue? [Y/N]:y
Do you want to save the server public key? [Y/N]:y
admin@192.168.1.1's password: 
Enter a character ~ and a dot to abort.

最后更新于