skip to content
Logo Faust

记录ssh连接报错

本地SSH配置启用了严格的主机密钥检查(strict host key checking)导致报错

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:2SuSk386vWazmFK17hIpEA+I13mEqzFEug0hiroQJsqKmQ.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:3
remove with:
ssh-keygen -f "/root/.ssh/known_hosts" -R "1145:7dc0:100:101:101::71b"
Host key for 1145:7dc0:100:101:101::71b has changed and you have requested strict checking.
Host key verification failed.

原因: 本地known_hosts文件中的记录过时 解决方案删除旧的密钥:

ssh-keygen -f "/root/.ssh/known_hosts" -R "1145:7dc0:100:101:101::71b"

再次连接即可