saber 酱的抱枕

Fly me to the moon

03/26
2023
软件

GitHub 提示 REMOTE HOST IDENTIFICATION HAS CHANGED!

刚才我在提交到 GitHub 仓库时看到提示 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! ,这么多年头一次遇到,搜索了一下发现是 GitHub 修改了它的 SSH key,所以以前的 key 失效了。

git push

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in /c/Users/xxxxx/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/xxxxx/.ssh/known_hosts:1
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

解决方法是执行 ssh-keygen -R github.com 删除之前保存的 key,或者打开 known_hosts 文件手动删除 github.com 所在的行。然后重新执行 git 操作,就可以获得新的 key,确认继续连接即可。
来自:https://stackoverflow.com/a/75830784

GitHub 提示 REMOTE HOST IDENTIFICATION HAS CHANGED!

09/17
2018
软件

处理 Git 错误:host key verification failed

我电脑上有一些 GitHub 上的仓库,前几天重装了系统,重新安装了 Git 客户端。今天我提交的时候遇到了错误:

host key verification failed

主机密钥验证失败。其实这个问题不在于 Git,而是和 SSH 相关。

SSH 连接流程:

在 3、4 步,远程主机发来了一个公钥,我们要决定是否接受。如果接受了,就会保存这个公钥,并开始连接。
Read More →

处理 Git 错误:host key verification failed