Github 访问时出现Permission denied (public key)
2013-11-04 12:59
183 查看
一. 发现问题:
使用 git clone 命令时出现Permission denied (public key) 。二. 解决问题:
1、首先尝试重新添加以前生成的key,添加多次,仍然不起作用。2、使用命令 ssh -v git@github.com测试,最后几行结果如下:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/gr/.ssh/id_rsa
debug1: Trying private key: /home/gr/.ssh/id_dsa
debug1: Trying private key: /home/gr/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).
3、分析:尝试了3个private key,但都没有成功,最后是导致Permission denied.
4、查看我的密钥, ls ~/.ssh/ :
bajie bajie.pub known_hosts
5、发现我的id_rsa文件我命令为bajie, 所以根本没有使用它。同时可以使用如下命令查看密钥列表:
ssh-add -l
6、上面命令的密钥列表为空,所以要添加我的密钥,使用命令:
gr@grpc:~/workspace/git/home$ ssh-add ~/.ssh/bajie
Enter passphrase for /home/gr/.ssh/bajie:
Identity added: /home/gr/.ssh/bajie (/home/gr/.ssh/bajie)
7、再次查看,如下,添加成功:
gr@grpc:~/workspace/git/home$ ssh-add -l
2048 63:c5:d8:6c:a0:0c:a8:9c:26:d8:f8:95:de:29:04:eb /home/gr/.ssh/bajie (RSA)
8、再使用ssh -v git@github.com测试连接,可以看到验证通过:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/gr/.ssh/bajie
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([192.30.252.129]:22).
9、最后git clone项目成功。
欢迎访问我的个人主页: www.forgerui.tk
相关文章推荐
- Github 访问时出现Permission denied (public key)
- Github 访问时出现Permission denied (public key)
- Github 访问时出现Permission denied (public key)
- Github 访问时出现Permission denied (public key)
- Github 访问时出现Permission denied (public key)
- github新建SSH key出现github permission denied<publickey>
- github错误 Agent admitted failure to sign using the key Permission denied (publickey)
- github错误:Permission denied to deploy key......
- [JavaScript]IE7,IE8浏览器请求本地资源出现access is denied拒绝访问[转载]
- 访问数据库时出现“Duplicate entry \'0\' for key \'PRIMARY\'错误“
- 关于Wireshark出现:Couldn't run /usr/sbin/dumpcap in child process: Permission denied Are you a member o
- 连接github Permission denied (publickey).解决
- 关于数据库连接时候出现用户无法访问的问题MetInfo Access denied for user 'ncdh'@'localhost' (using password: YES) ( 10
- 访问网站出现Directory Listing Denied 是什么原因? http://www.west999.com/faq/list.asp?Unid=258
- GIT ERROR: Permission to ********.git denied to deploy key fatal: Could not read from remot
- 【Git】GitLab备份出现Error No Access Permission Denied
- 【已解决】Ubuntu 12.04 LTS Source安装nodejs时出现"bash ./configure permission denied"
- 解决 Apache服务器下,访问出现"You don't have permission to …"
- 解决Jenkins+Gitlab出现的stderr: Permission denied权限问题
- 访问网站出现Access denied for user 'root'@'%' to database 'xxx'