置换新的mac电脑,链接git的时候,按照原来的方法进行关联,始终无法下拉代码
git config --global user.name "yourname"
git config --global user.email "your@email.com"
ssh-keygen -t rsa -C "your@email.com"
把公钥添加到github ssh公钥,clone代码时拉不下来,报错。
原因:
新的ssh客户端不支持ssh-rsa算法
解决方法:
要修改本地配置重新使用ssh-rsa算法,
1.到当前用户目录下的.ssh目录下创建config文件(config没有后缀)
cd .ssh/
2.使用vim指令或者使用记事本打开
3.复制下面内容粘贴到config文件中保存即可
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa