github 报错提示 ERROR: You're using an RSA key with SHA-1
,RSA不能用,需要升级
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.
解决办法:
# 生成新秘钥,如果报错 unknown key type ed25519,使用这个:ssh-keygen -t ecdsa -b 521 -C "[email protected]",一路回车(第一个回车是生成秘钥的名字,不给就默认,后两个是密码,可以不要)
$ ssh-keygen -t ed25519 -C "[email protected]"
# 启动 ssh 代理,根据环境,使用不同的命令
$ eval "$(ssh-agent -s)"
# 将秘钥添加到代理中,如果还有其他以前秘钥,也要添加进去
$ ssh-add id_ed25519
# 查看秘钥,并复制粘贴到GitHub
$ cat ~/.ssh/id_ed25519.pub
# 测试,最好是拉取一个项目看看,可不可以访问
$ ssh -T [email protected]
log
(pytorch) [yudong@admin1 Temp]$ git pull
ERROR: You are 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