跳到主要内容

SSH 常见问题

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

执行 ssh -i <私钥文件路径> <username>@<IP address or domain name> 时出现异常;

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:XXXXXXXXXXXXXXXXXXXXX/XXX/+XXXXXXXXXXXXXX/X.
Please contact your system administrator.
Add correct host key in /c/Users/XXXXX/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /c/Users/XXXXX/.ssh/known_hosts:24
Host key for XXX.XXX.XX.XX has changed and you have requested strict checking.
Host key verification failed.

解决:ssh-keygen -R "XXX.XXX.XX.XX"

Resources