ssh Host key verification failed.

完成线上服务器 切换后,链接ssh出现一下问题:

***.yuan@***yuan-ThinkPad-Edge-E430:~/kule/www.kuulabu.com$ scp [email protected]:/tmp/2014-09-17.10-16-05.+0000.Kuulabu.sql.gz /tmp/
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for www.kuulabu.com has changed,
and the key for the corresponding IP address 180.153.223.89
is unchanged. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
Offending key for IP in /home/***.yuan/.ssh/known_hosts:20
  remove with: ssh-keygen -f "/home/***.yuan/.ssh/known_hosts" -R 180.153.223.89
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
3d:d2:9b:28:33:49:02:43:91:0b:bf:3e:19:2f:98:55.
Please contact your system administrator.
Add correct host key in /home/***.yuan/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/***.yuan/.ssh/known_hosts:3
  remove with: ssh-keygen -f "/home/***.yuan/.ssh/known_hosts" -R www.kuulabu.com
RSA host key for www.kuulabu.com has changed and you have requested strict checking.
Host key verification failed.
***.yuan@***yuan-ThinkPad-Edge-E430:~/kule/www.kuulabu.com$ cd
***.yuan@***yuan-ThinkPad-Edge-E430:~$ vi /home/***.yuan/.ssh/known_hosts

错误原因是: 当通过ssh链接服务器的时候,系统会自动在自己的电脑上生成一个密钥,此密钥是要链接的域名和ip相关的。所以,由于我切换服务器后ip变了,所以出现错误。

解决方案:/home/***.yuan/.ssh/known_hosts:3  。

               编辑文件,删除文件中的第三行。

               或

               执行ssh-keygen -f "/home/***.yuan/.ssh/known_hosts 命令。

你可能感兴趣的:(ssh)