主机的Hostkey值改变,ssh连接失败

mac机器

bogon:~ mac$ ssh -p **22 root@**.*********.org


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:P73YH4G4Eedj7XrvYAmAst3/qtUS5E1WL8Dm8vUzDD8.
Please contact your system administrator.
Add correct host key in /Users/mac/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/mac/.ssh/known_hosts:34
RSA host key for [**.*********.org]:**22 has changed and you have requested strict checking.
Host key verification failed.



根据提示的意思我们就可以知道在本地的known_hosts保存的主机hostkey记录改变了,该记录的主键可以是所连主机的域名,也可以是所连主机的IP地址。 
我们可以进入到该文档删除对应行,也可以直接用以下的命令直接把known_host


rm -rf /Users/mac/.ssh/known_hosts


     本文转自phpervip 51CTO博客,原文链接:http://blog.51cto.com/phpervip/1972523,如需转载请自行联系原作者



上一篇:推荐一款 IDEA 生成代码神器,写代码再也不用加班了!


下一篇:【原创】开源.NET排列组合组件KwCombinatorics使用(二)——排列生成