- 问题
- 解决方案
这个问题是突然出现的.10月我还正常使用,11月以来,突然不能连接
我选择了codechina作为我的代码托管平台,因为Github容易被抢,Gitlab本地不方便.并按照程序创建了我的公钥,写入到codechina的SSH密钥中
ssh-keygen -t rsa -C 'danzhao@163.com' # 创建密钥
保存文件为/Users/danzhao/.ssh/id_rsa_codechina,自动生成对应的/Users/danzhao/.ssh/id_rsa_codechina.pub
将pub的文件贴到codechina平台的SSH密钥,新建好却发现不能连接
我仍然被否了
Cloning into 'python_web_linux'... git@codechina.csdn.net: Permission denied (publickey). fatal: Could not read from remote repository/ Please make sure you have the correct access rights and the repository exists.
我是创建人,肯定有权限,便给可以确定一定存在repo.所以各方去寻找答案
解决方案
网上的答案每次都是五花八门,这次也是
- 加密方式改成ed_25519试试…
- 默认会调用之前的密钥,都清除试试…
- 邮箱可能不对,确认下试试…
都不行
最后还是csdn官方客服牛逼
ssh-add ~/.ssh/id_rsa_codechina
成功连接
另附上过程中验证的代码
ssh -vvT git@codechina.csdn.net # 打印连接调试信息
ssh -T git@codechina.csdn.net # 测试是否可以连接



