有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,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.
当前回答
您可以使用Https url登录
我猜你是试图登录SSH url 当你说git push,如果它只要求密码,考虑你是通过ssh连接。最好使用HTTP url。
其他回答
如果您已经创建了SSH密钥,但仍然报错,这是因为您需要给用户读写要克隆到的文件夹的权限。sudo chmod 777 <your_folder_name_here>"。 当然,这是在生成SSH密钥之后,仍然会得到这个错误。希望这对未来的用户有所帮助。
Edit
如果你使用git bash,在Windows中使用admin来添加
你需要生成一个SSH密钥(如果你没有的话),并将公钥与你的Github帐户相关联。参见Github自己的文档。
允许对密钥(标识)进行写访问,然后单击“添加密钥”
如果在Windows上,请检查通过SSH使用Github中的更多详细信息。
我在AWS CodeCommit上也遇到了同样的问题。所有人都在一台笔记本电脑上工作,但另一台却没有。解决方案是在AWS配置部分的.ssh/config中删除'PreferredAuthentications publickey'行。
好吧,这个问题有一些解决方案,其中一些可能已经提到过了,但只是把它们放在一起:
确保您的键是存在的,默认情况下是另一个~/。Ssh /文件夹,即id。Rsa和id.rsa.pub 确保密钥有正确的权限,你可以运行chmod: Chmod 600 ~/.ssh/id_rsa . exe Chmod 644 ~/.ssh/id_rsa.pub 确保您的公钥(id_rsa.pub)的内容与远程存储库配置中上传的内容匹配 最后修复ssh代理的问题: ssh-add
更多信息:https://itcodehub.blogspot.com/2015/01/ssh-add-problems-with-ssh-agent-and.html