ssh 连接服务器时:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

 

错误如下及修复

 

 分析

主要原因是因为本地访问过服务器,会把服务器登录标识证书记录下来,下次登录时会去比对之前的记录,由于系统重装标识变了导致不能继续登录。

 解决:(xxxxx为服务器ip)清除本地缓存的证书:

ssh-keygen -R xxxxx

详细错误:

PS C:\Users\20190529\Desktop> ssh root@47.97.105.45
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:tPDE14GlZbjhc3qpM6TzhWGb91stZMcmF4SwWE6xCEc.
Please contact your system administrator.
Add correct host key in C:\\Users\\20190529/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\20190529/.ssh/known_hosts:7
ECDSA host key for 47.97.105.45 has changed and you have requested strict checking.
Host key verification failed.
PS C:\Users\20190529\Desktop> ssh-keygen -R 47.97.105.45
# Host 47.97.105.45 found: line 7
C:\Users\20190529/.ssh/known_hosts updated.
Original contents retained as C:\Users\20190529/.ssh/known_hosts.old

 

posted @ 2020-06-28 09:42  半城狂客  阅读(274)  评论(0编辑  收藏  举报