管理员
管理员
发布于 2023-12-04 / 91 阅读 / 0 评论 / 0 点赞

服务器重置后报 Host key verification failed.

问题

今天在登录服务器时,无法登录,问题如下

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 ED25519 key sent by the remote host is
SHA256:ThLbkAgaiGx999zrnUdH+25nzA9f0y4CzcR/mUuAP38.
Please contact your system administrator.
Add correct host key in /Users/buzhanguo/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in /Users/buzhanguo/.ssh/known_hosts:4
Host key for XX.XXX.XX.XXX has changed and you have requested strict checking.
Host key verification failed.
spawn_id: spawn id exp6 not open
    while executing
"interact"

解法

这里面有一句比较关键

ECDSA host key for XX.XXX.XX.XXX has changed and you have requested strict checking.

Host key verification failed.

这个问题是重置过服务器后。再次访问会出现这个问题。

处理起这个问题很简单,我们只需输入以下内容即可

xxx替换成你的服务器IP

ssh-keygen -R  XX.XXX.XX.XXX 

评论