linux ssh 报 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED 的解决方法

如下错误

$ ssh root@172.16.12.189
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 RSA key sent by the remote host is
SHA256:BD+piZ5d2uefHAUqA3gSHBs1s8IGLYneQvuFhLL2Mgo.
Please contact your system administrator.
Add correct host key in /home/ifnk/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/ifnk/.ssh/known_hosts:60
Host key for 172.16.12.189 has changed and you have requested strict checking.
Host key verification failed.

其实 错误 已经 告诉你 了 在 /home/ifnk/.ssh/known_hosts:60 这个文件下 的 公钥修改了, 导致连不上

解决方法就 是 执行 ssh-keygen -R 172.16.12.189 命令,将 对应 机器的公钥信息 删除即可 ,

然后 重新 ssh 就能连上啦!

posted @ 2022-06-23 16:10  ifnk  阅读(87)  评论(0编辑  收藏  举报