github 解决推拉代码提示 REMOTE HOST IDENTIFICATION HAS CHANGED 失败
报错提示如下
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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/lindexi/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/lindexi/.ssh/known_hosts:2
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
最简单的方式就是删除上面提到的 known_hosts
文件,例如我的文件是 /c/Users/lindexi/.ssh/known_hosts
路径,直接使用 rm 命令删除,代码如下
rm /c/Users/lindexi/.ssh/known_hosts
还请在你电脑上执行以上命令的时候,替换为你自己的电脑上的路径
执行完成之后,重新推拉代码,可以看到以下提示信息,只需要输入 yes 回车即可
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?
以上步骤就是在将 github 添加到 known_hosts
文件里
也就是下一次推拉代码就不需要再次执行以上步骤
为什么有这样的事情呢?这是因为在 2023.03.24 更换了 GitHub 的 RSA 的 Key 值。因为 GitHub 团队发现自己的 Key 泄露了。详细请看 We updated our RSA SSH host key The GitHub Blog
博客园博客只做备份,博客发布就不再更新,如果想看最新博客,请访问 https://blog.lindexi.com/
如图片看不见,请在浏览器开启不安全http内容兼容

本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。欢迎转载、使用、重新发布,但务必保留文章署名[林德熙](https://www.cnblogs.com/lindexi)(包含链接:https://www.cnblogs.com/lindexi ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请与我[联系](mailto:lindexi_gd@163.com)。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 【.NET】调用本地 Deepseek 模型
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
2020-09-05 dotnet 在 UOS 国产系统上使用 MonoDevelop 创建 GTK 全平台带界面应用
2020-09-05 dotnet 在 UOS 国产系统上使用 MonoDevelop 进行拖控件开发 GTK 应用
2020-09-05 dotnet 在 UOS 国产系统上安装 MonoDevelop 开发工具
2020-09-05 dotnet 在 UOS 国产系统上使用 Xamarin Forms 创建 xaml 界面的 GTK 应用
2020-09-05 dotnet 在 UOS 国产系统上安装 dotnet sdk 的方法
2020-09-05 dotnet 在国产 UOS 系统利用 dotnet tool 工具做文件传输