SSH 无法对 git@github.com 进行身份验证 [英] SSH cannot authenticate to git@github.com
问题描述
最近,我在 Github.com 上注册了一个免费计划.我按照他们的说明生成一个 ssh 密钥以添加到我的帐户.但是,当我尝试 ssh -v git@github.com
时,出现此错误:
Recently, I sign up for a free plan on Github.com.
I follow their instructions to generate a ssh key to add to my account.
However, when I try ssh -v git@github.com
, I get this error:
debug1: Server accepts key: pkalg ssh-rsa blen 277
Agent admitted failure to sign using the key.
debug1: Trying private key: /home/phuongnd08/.ssh/identity
debug1: Trying private key: /home/phuongnd08/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
当我查看错误时,我在这里看到一个有趣的事情,那就是 .ssh/id_rsa 没有尝试过,只是尝试了 .ssh/identity 和 .ssh/id_dsa.
When I look into the error, I see a funny thing here, that is the .ssh/id_rsa was not tried, just .ssh/identity and .ssh/id_dsa were tried.
我该如何解决这个错误?谢谢
How can I fix this error? Thanks
推荐答案
检查您的密钥的文件权限.如果他们过于自由,可能会拒绝使用钥匙.确保他们只对你有权限 (0700).
Check the file permissions on your key. If they are too liberal it may be refusing to use the key. Make sure they only have perssion for you (0700).
这篇关于SSH 无法对 git@github.com 进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!