跳到主要内容

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"

Github 操作提示 kex_exchange_identification: Connection closed by remote host 异常

确保远程与本地 SSH 密钥已配置,并先尝试验证 eval "$(ssh-agent -s)"ssh-add ~/.ssh/<key>ssh -T [email protected] 是否正常。

如果不行,尝试 通过 HTTPS 启用 SSH 连接 操作 (ssh-config)。

Resources