首页 > 代码库 > WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED
原文地址:http://linuxme.blog.51cto.com/1850814/375752
今天将阿里云服务器更换了一下系统盘,重启成功后,再次通过终端访问阿里云的公网IP报以下信息:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:gul+NDB/fihQee0WCsbRX5RuY8FQtN8CQN4F7Mi0nlw.
Please contact your system administrator.
Add correct host key in /Users/idealist/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/idealist/.ssh/known_hosts:1
RSA host key for 60.205.150.104 has changed and you have requested strict checking.
Host key verification failed.
在网上找了解决方法,经实验,可用,遂记录一下备忘。
解决方法:
先cat一下本地目录的.ssh/know_hosts,命令如下:
cat ~/.ssh/known_hosts
会显示之前连接的信息:
公网的IP地址 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA7ajWUd/WHci2gMjGuum3W1DK3r1eXJcnp6ntAZ/jAAAcOvHg4awlqwOkyAUOqTtuJ6gUqBxoxUYiYdU1os6P5GxYm1G25CjfRaYLyW5bssgmnXKAraVi29bMP4NzjGdvLzv0j4b5+y4D7pXw8N2qbeLtOuOMa2VnoOO5YNir62xOLlmg4G9gUm0KvJ6xYNEVwekz29K8xDdQs9IA+t538umzetoDB54PgaHY7PPiYNJKuKiIr0absjHgQjAsSAgOCv83GkzQp23FO6T0PwMpSqxrRSWZniSWDS8rQgR3xjdVz1A6lFXZs6U5JqOJEFjs4Lgdd4/djQAzR4WUEOO1cw==
编辑此文件:
vim ~/.ssh/known_hosts
将这些信息删除并保存文件即可。
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED