您的位置:首页 > 其它

ssh连接提示“REMOTE HOST IDENTIFICATION HAS CHANGED! ”解决办法

2016-04-02 23:38 423 查看
接上一篇安全狗的博客,由于ab压测触发了安全狗的防御机制,将我的IP加到iptables黑名单了。当时我也不知道具体原因,就通过同一网络的其它节点试图ssh连接到那台nginx服务器上看看究竟出了什么情况。
但是在连接时候弹出类似下面的提示:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 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 the RSA host key has just been changed.The fingerprint for the RSA key sent by the remote host is36:68:a6:e6:43:34:6b:82:d7:f4:df:1f:c2:e7:37:cc.Please contact your system administrator.Add correct host key in /u/xlian008/.ssh/known_hosts to get rid of this message.Offending key in /u/xlian008/.ssh/known_hosts:2RSA host key for 135.1.35.130 has changed and you have requested strict checking.Host key verification failed.

后来百度了下,找到原因了:
ssh会把你每个你访问过计算机的公钥(public key)都记录在~/.ssh/known_hosts。当下次访问相同计算机时,OpenSSH会核对公钥。如果公钥不同,OpenSSH会发出警告,避免你受到DNS Hijack之类的攻击。

既然找到原因了,那就好解决了,直接编辑~/.ssh/known_hosts,将需要连接的那个IP相关rsa信息删除即可。,再次成功的话,它会将内容继续写入到 ~/.ssh/known_hosts中。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: