1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > git clone之报错git@gitee.com: Permission denied (publickey).fatal: Could not read from remote repositor

git clone之报错git@gitee.com: Permission denied (publickey).fatal: Could not read from remote repositor

时间:2019-04-24 07:21:57

相关推荐

git clone之报错git@gitee.com: Permission denied (publickey).fatal: Could not read from remote repositor

git clone之报错git@: Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists.

在载资源的时候,出现下面的错误

因为没有正确设置公私钥,导致没有权限操作。

解决办法

1、先查看一下自己有没有生成过public key

cat ~/.ssh/id_rsa.pub

如果有的话是以ssh-rsa开头,以账号的注册邮箱结尾的

我这里是有的,但是为什么报错呢,因为是不同的邮箱,也就是两个账号,这里可以自己找找之前的文件,打开看看是否是当前账号所绑定的邮箱

这里没有当前用的账号的邮箱的public key,所以得重新生成

2、生成公私钥

ssh-keygen -t rsa -C “xxxxx@”

这里的xxxxx@是你自己的账号邮箱

然后使用记事本打开.puh文件,Ctrl+A全选,Ctrl+C复制所有的内容

3、将public key添加到码云

打开自己的Gitee的设置–>ssh公钥

/profile/sshkeys

将上一步复制的内容完整的粘贴入框中,并自己起个名字

4、可以自己验证一下是否成功

ssh -T git@

5、然后就可以继续clone

就成功了

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。