Linux远程连接服务器异常修复(WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!)

今天要给测试部署程序,想要通过ssh 登录上去将压缩包解压,但是报了下面的异常

~ ⌚ 22:49:52
$ ssh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 ECDSA key sent by the remote host is
SHA256:8hgJ8jpcBr1tm6HS72FpXwMrjba8MQqlqYJQLPB/Qf4.
Please contact your system administrator.
Add correct host key in /Users/wangdong/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/wangdong/.ssh/known_hosts:26
ECDSA host key for 47.98.233.15 has changed and you have requested strict checking.
Host key verification failed.

之前一直都可以正常登录上去,并且让测试人员自己登录,也是可以登录上去的,但是我自己电脑上却一直包这个错误。

经过一番查找,最后发现是系统日志里面有错误信息的原因。

解决方法:

1、看错误日志中有一句

Add correct host key in /Users/wangdong/.ssh/known_hosts to get rid of this message.

2、以编辑器的方式进入这个文件,并且通过 :set nu  让里面显示行数,删掉错误提示里的行数。26行

1)centos 6这样

vi /Users/wangdong/.ssh/known_hosts

2)centos 7 版本这样

vi /home/peixp/.ssh/know_hosts

 

3、vi 打开后的日志情况如下

Linux远程连接服务器异常修复(WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!)_第1张图片

4、然后再连接就可以了

 

 

你可能感兴趣的:(Linux远程连接服务器异常修复(WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!))