有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,GitHub存储库存在,我不知道现在该做什么。
> 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.
有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,GitHub存储库存在,我不知道现在该做什么。
> 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.
当前回答
我最近也遇到了同样的问题。如果您需要立即修复,这可能会有所帮助,但每次重新启动系统时都需要这样做
在终端执行:ssh-add ~/.ssh/id_rsa
输入系统密码就可以了。
其他回答
可能您的ssh-agent未启用 你可以试试
下载
http://git-scm.com/
安装它 使ssh-agent
C:\Program Files\Git\cmd
start-ssh-agent
我试图用几个小时来解决类似的问题。最后,我删除了所有的密钥,并创建了没有密码的新密钥,最终摆脱了这个问题。
问题是SSH密码,需要删除!
我想我有最好的答案给你,你的git应用程序读取你的id_rsa。根用户目录下的Pub
/home/root/.ssh/id_rsa.pub
这就是为什么你的密钥在/home/your_username/.ssh/id_rsa中。少年犯看不懂酒吧。因此,您需要在/home/root/.ssh/中创建密钥
$ sudo su
$ ssh-keygen
$ cd ~/.ssh
$ cat id_rsa.pub
然后复制密钥在你的github帐户。 这对我很有效。你可以试试。
我想补充一些我的发现:
如果您正在使用GitBash,那么请确保SSH密钥存储在~/. SSH /id_rsa中。
默认情况下,git会搜索~/。ssh/id_rsaas ssh密钥的默认路径。
甚至文件名id_rsa也很重要。如果您将SSH密钥保存在另一个文件名或路径中,它将抛出Permission Denied(publickey)错误。
这对我很有用
有2个选项在github - HTTPS/SSH
我错误地选择了SSH,因此出现了错误-_-
切换到HTTPS,然后复制url再次尝试:)