ssh 远程登录 REMOTE HOST IDENTIFICATION HAS CHANGED 问题

ssh 远程登录 REMOTE HOST IDENTIFICATION HAS CHANGED 问题

问题:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 RSA key sent by the remote host is
da:f7:3e:ba:f7:00:e6:44:76:f2:58:6e:48:******.
Please contact your system administrator.
Add correct host key in /home/name/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/name/.ssh/known_hosts:17
RSA host key for xx.xx.xx.xx has changed and you have requested strict checking.
Host key verification failed.

原因:

由于服务器重新安装系统了,所以会出现以上错误。

解决方式:

ssh-keygen -R 服务器端的ip地址

会出现以下提示

# Host [服务器IP] found: line 17 type RSA
/home/name/.ssh/known_hosts updated.
Original contents retained as /home/name/.ssh/known_hosts.old

重新连接服务器即可


那么 ssh-keygen 命令是什么:

该命令的作用是:生成 SSH 秘钥对

https://git-scm.com/book/zh/v2/%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84-Git-%E7%94%9F%E6%88%90-SSH-%E5%85%AC%E9%92%A5

posted @ 2020-06-12 19:05  leafs99  阅读(151)  评论(0编辑  收藏  举报