【重装系统SSH连不上】 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

问题

centos在重装系统后再连接,无法连接上
[root@aisa ~]# ssh [email protected]

ssh [email protected]

无法连接上,输出是:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:xxxxxxxxx/xxxxxxx/xxxxxxx.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:18
ECDSA host key for 192.168.0.3 has changed and you have requested strict checking.
Host key verification failed.

解决:

删除服务器 192.168.0.3 的相关 rsa 的信息

ssh-keygen -R 192.168.0.3

原因:

之前使用过本机连接过 192.168.0.3 在 192.168.0.3 重装系统后,本机现有的密钥不被认可,就会弹出警告。这时只需要删除密钥,重新连接即可(重新连接时会下发新的密钥)

你可能感兴趣的:(ssh,运维)