远程时如下报错:

    1. admin@issp:~$ ssh root@100.64.15.251
    2. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    3. @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
    4. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    5. IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    6. Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    7. It is also possible that a host key has just been changed.
    8. The fingerprint for the ECDSA key sent by the remote host is
    9. SHA256:lgzULGKimjmAFFK4iH8JKZXAfq/SwJb16ppK9+OkYLY.
    10. Please contact your system administrator.
    11. Add correct host key in /home/admin/.ssh/known_hosts to get rid of this message.
    12. Offending ECDSA key in /home/admin/.ssh/known_hosts:4
    13. remove with:
    14. ssh-keygen -f "/home/admin/.ssh/known_hosts" -R 100.64.15.251
    15. ECDSA host key for 100.64.15.251 has changed and you have requested strict checking.
    16. Host key verification failed.

    原因应该是远程主机的认证信息修改了,本地还是保存了老的认证信息,所以需要删除,就是在进行第一次连接时选择的保存,如下所示:

    1. admin@issp:~$ ssh root@100.64.15.251
    2. The authenticity of host '100.64.15.251 (100.64.15.251)' can't be established.
    3. ECDSA key fingerprint is SHA256:lgzULGKimjmAFFK4iH8JKZXAfq/SwJb16ppK9+OkYLY.
    4. Are you sure you want to continue connecting (yes/no)? yes
    5. Failed to add the host to the list of known hosts (/home/admin/.ssh/known_hosts).

    修复方式
    删除对应保存的认证信息即可,根据提示确认是第四行

    1. root@issp:~# ssh-keygen -f "/home/admin/.ssh/known_hosts" -R 100.64.15.251
    2. # Host 100.64.15.251 found: line 4

    vim删除对应文件 “/home/admin/.ssh/known_hosts” 的第四行即可