首页 > 其他 > 详细

git push是报Permission denied (publickey)错误解决

时间:2015-07-24 15:38:11      阅读:266      评论:0      收藏:0      [点我收藏+]

今天晕了半天了,搞了个git工程到github上,以为很简单,因为之前也弄过,那知道搞了大半天都搞不好,一直报如下错误

D:\javawork\ee-0.0.1-SNAPSHOT>git push -u origin master
Warning: Permanently added the RSA host key for IP address ‘192.30.252.130‘ to t
he 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.

查看了官网说明

https://help.github.com/articles/generating-ssh-keys/

主要是如下几步骤

1 ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

2 ssh-agent -s

3 ssh-add ~/.ssh/id_rsa

4 再把公钥加入到github网站上去

 

但就卡在第3步了,ssh-add ~/.ssh/id_rsa这个一直执行不成功

报Permission denied (publickey).

 

找了很多资料,有说要ssh-agent bash

有说ssh-agent
       ssh-add ~/.ssh/id_key

 

都不行,最后看到一片文章

http://blog.csdn.net/wswqiang/article/details/7200022

大概意思要使用windows Git 版本,试了下,还真行,在windows Git上不用执行ssh-add,即可git push成功

自此,问题解决。

git push是报Permission denied (publickey)错误解决

原文:http://www.cnblogs.com/xywq/p/4673428.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!