本文介绍了无法推送到git存储库 - 权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下问题:
$ git push -u origin master
权限被拒绝(publickey)。
致命:无法从远程存储库读取。
请确保您拥有正确的访问权限
并存在存储库。
我已经检查过这个连接:
$ ssh -vT git@github.com
和输出看起来不错,我正确认证。
在进一步检查时,我注意到:
$ ssh-add -l
座席没有身份。
我曾尝试运行ssh-agent,但没有任何更改:
$ ssh-agent
SSH_AUTH_SOCK = / tmp / ssh-A1mhFqvqncuO / agent.766;导出SSH_AUTH_SOCK;
SSH_AGENT_PID = 767;导出SSH_AGENT_PID;
echo Agent pid 767;
$ ssh-add -l
无法打开与身份验证代理的连接。
我正在使用Arch Linux。任何帮助将非常感谢!提前致谢!
解决方案
我遇到过类似的问题,并且通过运行以下命令将我的密钥添加到已知密钥的列表:
ssh-add〜/ .ssh / id_rsa
希望它也解决了你的问题。 ;)
I have a following problem:
$ git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have already checked the connection doing this:
$ ssh -vT git@github.com
and output looks good, I was correctly authenticated.
While checking further, I noticed that:
$ ssh-add -l
The agent has no identities.
I have tried to run ssh-agent, but nothing changed:
$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-A1mhFqvqncuO/agent.766; export SSH_AUTH_SOCK;
SSH_AGENT_PID=767; export SSH_AGENT_PID;
echo Agent pid 767;
$ ssh-add -l
Could not open a connection to your authentication agent.
I am using Arch Linux. Any help would be strong appreciated! Thanks in advance!
解决方案
I had the similar problem and my problem was solved by running the following command to add my key to the list of known keys:
ssh-add ~/.ssh/id_rsa
Hope it solves yours too. ;)
这篇关于无法推送到git存储库 - 权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!