错误如下及修复:
分析:
主要原因是因为本地访问过服务器,会把服务器登录标识证书记录下来,下次登录时会去比对之前的记录,由于系统重装标识变了导致不能继续登录。
解决:(xxxxx为服务器ip)清除本地缓存的证书:
ssh-keygen -R xxxxx
详细错误:
PS C:Users20190529Desktop> 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:Users20190529Desktop> ssh-keygen -R 47.97.105.45 # Host 47.97.105.45 found: line 7 C:Users20190529/.ssh/known_hosts updated. Original contents retained as C:Users20190529/.ssh/known_hosts.old