@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:AMefxIIZnNi8oKG/iOTOS747UOfhJr045W6Q0z/OE9M.
Please contact your system administrator.
Add correct host key in /Users/zhengxiaomei/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/zhengxiaomei/.ssh/known_hosts:2
ECDSA host key for 9.60.18.230 has changed and you have requested strict checking.
Host key verification failed.
错误提示如上所示,由于重装了系统,导致之前保存的230机器公钥失效,需要在本地讲失效公钥删除,方法如下:
1、ssh-keygen -R 9.60.18.230
2、在文件/.ssh/know_hosts中讲9.60.18.230该行删除
再次使用 ssh root@9.60.16.230时,会提示是否更新公钥,
**************************************************************************
/Users/zhengxiaomei/.ssh/known_hosts updated.
Original contents retained as /Users/zhengxiaomei/.ssh/known_hosts.old
zhengdembp:~ zhengxiaomei$ ssh root@9.60.18.230
The authenticity of host '9.60.18.230 (9.60.18.230)' can't be established.
ECDSA key fingerprint is SHA256:AMefxIIZnNi8oKG/iOTOS747UOfhJr045W6Q0z/OE9M.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '9.60.18.230' (ECDSA) to the list of known hosts.
至此,问题解决。
本文介绍了解决SSH连接时遇到的公钥验证失败问题,包括如何移除失效的公钥及更新known_hosts文件。
1372

被折叠的 条评论
为什么被折叠?



