Linux系统重装后SSH连接报错处理
当使用SSH协议从一台Linux主机远程连接另一台Linux服务器时,可能会遇到如下报错信息:
[root@server .ssh]# ssh 192.0.50.80 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 the RSA host key has just been changed. The fingerprint for the RSA key sent by the remote host is 97:d3:d4:f1:c9:c6:2e:40:93:b2:a8:70:45:e8:d2:6c. Please contact your system administrator. Add correct host key in /root/.ssh/known_hosts to get rid of this message. Offending key in /root/.ssh/known_hosts:1 RSA host key for 192.0.50.80 has changed and you have requested strict checking. Host key verification failed. [root@server .ssh]#
该问题通常发生在目标服务器的SSH服务被重新安装或操作系统经历重装之后,导致原有的RSA主机密钥失效。要解决此问题并重新建立连接,只需执行命令 mv /root/.ssh/known_hosts /tmp 将旧的主机密钥记录文件移动至临时目录,随后即可正常登录。
以上即为针对Linux系统重装后导致免密码Key登录失败问题的完整解决方案,感谢阅读。