git clone 出错:Permission denied (publickey).

网上找了好久的解决方案,全都试了一遍,结果还是不行=。=

今天又想弄一下了,毕竟老是用笔记本也不太方便。。。终于找到了一个有效的解决方案,已经成功了。

 

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值