Permission denied (publickey). fatal: Could not read from remote repository

转载请标明出处:http://blog.csdn.net/donkor_/article/details/77502800

前言

Warning: Permanently added the RSA host key for IP address '192.29.255.115' 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

今天在上传项目到github时候,出现了上述描述的错误。这个应该是很多github新手经常出错的问题,其实就是没有在你github上添加一个公钥。

▲ 解决方案(图文教程)
1 . 使用 ssh -T [email protected] 测试一下,得到Permission denied(publickey).意思表示缺少公钥。

ssh -T git@github.com

2 . 输入ssh-keygen -t rsa -C "ChenYXin",之后猛击下一步(Enter),当看到RSA 2048的框框时,表示成功生成公钥。ChenYXin是我本人的github账号。记住保存公钥的地址,第三步要用。
Permission denied (publickey). fatal: Could not read from remote repository_第1张图片

ssh-keygen -t rsa -C "ChenYXin"

3 . cat 一下第二步保存的公钥地址,在控制台将公钥复制下来。
Permission denied (publickey). fatal: Could not read from remote repository_第2张图片

cat in /User/~~/.ssh/id_rsa.pub

4 . 登录github账号,添加刚刚复制的公钥
step one
Permission denied (publickey). fatal: Could not read from remote repository_第3张图片

step two
Permission denied (publickey). fatal: Could not read from remote repository_第4张图片

step three

step four
这里的title并不重要,可不填
Permission denied (publickey). fatal: Could not read from remote repository_第5张图片

▲ 如果还没解决,要不您换个姿势再试试(google)


About me
Email :[email protected]
Android开发交流QQ群 : 537891203
Android开发交流群

你可能感兴趣的:(git)