码迷,mamicode.com
首页 > 其他好文 > 详细

$ ssh -T -v git@github.com_在本地用ssh连接github出错_git@github.com: Permission denied (publickey).

时间:2020-02-23 16:14:12      阅读:72      评论:0      收藏:0      [点我收藏+]

标签:上传   很多   trying   显示   dsa   ssh   eth   本地   hub   

$ ssh -T -v git@github.com报错:

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/eveline/.ssh/id_rsa
debug1: Trying private key: /Users/eveline/.ssh/id_dsa
debug1: Trying private key: /Users/eveline/.ssh/id_ecdsa
debug1: Trying private key: /Users/eveline/.ssh/id_ed25519
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).

Troubleshooting(macOS系统)

**看了很多博客和官方文档,我的解决方法如下

先查看一下配置信息

$ ssh-add -l
The agent has no identities.
如果是这样,就是没有添加成功私人密钥,虽然已经生成了并且上传到了GitHub的ssh

$ ssh-add ~/.ssh/id_rsa #这个id_rsa应是你命名的私人密钥默认名,这里显示为没有此文件。我在生成时命名为了Jack_key
/Users/eveline/.ssh/id_rsa: No such file or directory

搞清楚了,开始行动

找到.ssh文件,添加我生成的private key文件到该文件夹下,然后执行下面命令:

$ ssh-add ~/.ssh/Jack_key
Identity added: /Users/eveline/.ssh/Jack_key (/Users/eveline/.ssh/Jack_key)

好了,查看一下

$ ssh-add -l
2048 SHA256:Dd02IHmxxxxx...xxxxxxxxxFPsHkGxiVh48m0qI /Users/eveline/.ssh/Jack_key (RSA)

如此,则配置成功!

大功告成

$ ssh -T -v git@github.com即可

$ ssh -T -v git@github.com_在本地用ssh连接github出错_git@github.com: Permission denied (publickey).

标签:上传   很多   trying   显示   dsa   ssh   eth   本地   hub   

原文地址:https://www.cnblogs.com/lyzz1314/p/12350098.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!