网上找了好久的解决方案,全都试了一遍,结果还是不行=。=
今天又想弄一下了,毕竟老是用笔记本也不太方便。。。终于找到了一个有效的解决方案,已经成功了。
git clone ssh://xxx
正克隆到 'xxx'...
Warning: Permanently added '[git.xxx.cn]:29418,[xx.xx.xx.xx]:29418' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
刚开始找到一个解决方案,执行如下:
git remote remove origin
error: 不能移除配置小节 'remote.origin' //莫名的错误。。。
ssh-add -D
All identities removed.
rm -r ~/.ssh
ssh-keygen -t rsa -C "xxx@example.com"
重新添加 cat ~/.ssh/id_rsa.pub 以后
再次执行git clone,仍然报错:
git clone ssh://xxx@git.example.cn:29418/xxx
正克隆到 'xxx'...
The authenticity of host '[git.xxx.cn]:29418 ([xx.xx.xx.xx]:2941