我是靠谱客的博主 舒适蜡烛,这篇文章主要介绍git 出现 ERROR: You‘re using an RSA key with SHA-1, which is no longer allowed1. 问题描述2. 原因分析3. 解决方案4. 参考资料,现在分享给大家,希望可以做个参考。
目录
- 1. 问题描述
- 2. 原因分析
- 3. 解决方案
- 3.1 生成ECDSA密钥
- 3.2 打开github的SSH keys页面
- 3.3 在github中设置公钥。
- 4. 参考资料
1. 问题描述
git pull时(或git push, git clone等),出现如下问题。

2. 原因分析
原因是在2022年3月15日之后,github不再支持SHA-1的加密方式了。
3. 解决方案
将SHA-1的加密方式修改为ECDSA的方式,并把公钥加入到github中,具体操作步骤如下。
3.1 生成ECDSA密钥
执行如下命令。
ssh-keygen -t ecdsa -b 521 -C "your_email@example.com"
按照如下截图操作。

生成好了之后会在~/.ssh目录中看到多出两个文件id_ecdsa和id_ecdsa.pub,分别为私钥和公钥。
3.2 打开github的SSH keys页面
从github的右上角点击向下的小箭头,然后选择Settings。

选择SSH and GPG keys,然后点击New SSH key。

3.3 在github中设置公钥。
首先执行命令gedit ~/.ssh/id_ecdsa.pub打开ECDSA的公钥,复制全部内容,粘贴到下边位置。

4. 参考资料
- https://stackoverflow.com/questions/71500791/eclipse-git-youre-using-an-rsa-key-with-sha-1-which-is-no-longer-allowed-pl
- https://exerror.com/youre-using-an-rsa-key-with-sha-1-which-is-no-longer-allowed-please-use-a-newer-client-or-a-different-key-type/
- github拉取代码报:You‘re using an RSA key with SHA-1, which is no longer allowed
- https://github.blog/2021-09-01-improving-git-protocol-security-github/
最后
以上就是舒适蜡烛最近收集整理的关于git 出现 ERROR: You‘re using an RSA key with SHA-1, which is no longer allowed1. 问题描述2. 原因分析3. 解决方案4. 参考资料的全部内容,更多相关git内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复