mac电脑重装系统,去官网下载了最新的git安装,一路next下来,打开bash按老路子设置,生成公钥
git config --global user.name "yourname"
git config --global user.email "your@email.com"
ssh-keygen -t rsa -C "your@email.com"
把公钥添加到百度云,clone代码时拉不下来,报错。

查看自己是开发者权限,重置一遍公钥再添加也不行,去网上找方法,
原因:
介绍这种情况的原因就是新的ssh客户端不支持ssh-rsa算法
解决方法:
要修改本地配置重新使用ssh-rsa算法,
1.到当前用户目录下的.ssh目录下创建config文件(config没有后缀)
cd .ssh/

2.使用vim指令或者使用记事本打开

3.复制下面内容粘贴到config文件中保存即可
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
文章讲述了在Mac电脑重装系统后,使用新版本Git遇到克隆代码失败的问题,原因是新的ssh客户端不支持ssh-rsa算法。解决方法包括创建并编辑.ssh/config文件,指定HostkeyAlgorithms和PubkeyAcceptedKeyTypes为ssh-rsa。
3620

被折叠的 条评论
为什么被折叠?



