Host key verification failed.

灰太狼 2023-09-29 14:39 104阅读 0赞

问题现象:
ssh 远程到远端服务器报错

  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:NHg/pDwRdtQThZzY3Z4Uwq/Rz93FgmL3UdBAFleWFWk.
  9. Please contact your system administrator.
  10. Add correct host key in /Users/yuanting/.ssh/known_hosts to get rid of this message.
  11. Offending ECDSA key in /Users/yuanting/.ssh/known_hosts:102
  12. ECDSA host key for 192.168.198.190 has changed and you have requested strict checking.
  13. Host key verification failed.

原因:

  1. 因为服务器的ip发生变更了
  2. 第一次SSH连接时,会生成一个认证,储存在客户端(也就是用SSH连线其他电脑的那个,自己操作的那个)中的known_hosts,但是如果服务器验证过了,认证资讯当然也会更改,服务器端与客户端不同时,就会跳出错误.

解决办法:

  1. 输入命令:ssh-keygen -R +服务器的IP
  2. ssh-keygen -R 服务器的IP

发表评论

表情:
评论列表 (有 0 条评论,104人围观)

还没有评论,来说两句吧...

相关阅读