$ ssh -T -v git@github.com_在本地用ssh连接github出错_git@github.com: Permission denied (publickey).
Posted lyzz1314
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了$ ssh -T -v git@github.com_在本地用ssh连接github出错_git@github.com: Permission denied (publickey).相关的知识,希望对你有一定的参考价值。
$ 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).的主要内容,如果未能解决你的问题,请参考以下文章