用ssh时 提示WARNING: POSSIBLE DNS SPOOFING DETECTED!处理方法 (2011-04-25 10:53:25)转载▼
1、起因:远程连接某一台Linux服务器A,然后又通过A来ssh连接另一台服务器B时发生
2、PUTTY返回提示信息如下:
user:/$ ssh xxx.xxx.xxx.xxx
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 is
25:d7:4d:2f:2d:87:9d:5a:fe:d2:c3:d9:a4:e7:4c:9e.
Please contact your system administrator.
Add correct host key in /home/XXX/.ssh/known_hosts to get rid of this message.
Offending key in /home/sjcool/.ssh/known_hosts:3
RSA host key for [218.XXX.XXX.XXX]:22 has changed and you have requested strict checking.
3、网上类似情况的解决说明:
3.1
其实这是客户机问题,与SSH服务器无关,只需把.ssh目录下的文件删除即可。下次使用ssh时文件会重建的。
出现这问题的原因一般是同一主机使用了不同的用户名登陆。(如果多个域名和多个IP同时指向同一主机,ssh仍然视为不同主机。)
fuck@A8:/
cd fuck@A8:
cd .ssh/
fuck@A8:~/.ssh
lsknownhostsfuck@A8: /.ssh
rm known_hosts
再ssh一次就可以了!
以上是Linux的方法。
Windows下面也是大致相同,都是要找到.ssh文件夹。
4、解决办法:
删除~/.ssh/known_hosts 的内容,然后重新连接即可