今天从
github 拉取私有项目时,出现报错,内容如下:
ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
是
SSH 密钥支持问题,重新生成依然不可用。
仔细看错误提示,从错误下面给出的官方文档
https://github.blog/2021-09-01-improving-git-protocol-security-github/ 可以看到,
github 对SSH密钥做了升级,原来的SHA-1等一些已经不支持了。
解决
生成新的
Ed25519 密钥对:
ssh-keygen -t ed25519 -C "your-email"
命令会生成两个新的密钥对:
id_ed25519
id_ed25519.pub
然后去
github => setting => SSH and GPG keys 里面,将原来的不支持的对应机器的
key 删除掉,然后添加新生成的
key (id_ed25519.pub)就行了。