当前位置:   article > 正文

解决ssh key过时问题

linux中ssh key认证过期了怎么处理 csdn

当我们使用ssh root@ip登录Linux服务器时,服务器报错:

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

如何解决?原因分析:

这是由于,ssh连接服务器时,如果之前连接过,ssh会默认保存该ip的连接协议信息,当我们再次访问此ip服务器时,ssh会自动匹配之前ssh保存的信息,由于我们的服务器做了更改,例如重装系统等操作,会导致本地保存的ssh信息失效,于是再次连接时就会出现上述错误。

另外,远程服务器的ssh服务被卸载重装或ssh相关数据(协议信息)被删除也会导致这个错误。

解决方案:

删除本地known_hosts里面的缓存信息即可。`命令:ssh-keygen -R "你的远程服务器ip地址"  ```

注意:R是大写

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/654233
推荐阅读
相关标签
  

闽ICP备14008679号