ERROR: You’re using an RSA key with SHA-1, which is no longer allowed.
通过baidu,从错误下面给出的官方文档 https://github.blog/2021-09-01-improving-git-protocol-security-github/ 可以看到,github对SSH密钥做了升级,原来的SHA-1,rsa等一些已经不支持了,由于我使用的是rsa,可能和大部分用户一样,所以今天在push代码时候遇到了这个问题,记录以下。
生成新的Ed25519密钥对:
ssh-keygen -t ed25519 -C "your-email"
一路回车。
会在.ssh目录下生成两个文件
id_ed25519
id_ed25519.pub
将id_ed25519.pub文件中的内容copy,拿出来到github上
这里:
添加一个新的ssh keys即可
验证key是否可用:使用 ssh -T git@github.com
对ssh key 进行验证
之后就可以正常使用push命令上传了。