Github SSH 权限被拒绝部署密钥

Ron*_*nin 9 git ssh

我创建了一个新的存储库,能够使用 SSH 进行克隆并提交以及所有内容。但是当我尝试推送时,出现以下错误:

ERROR: Permission to Ronin11/MealPlanr.git denied to deploy key
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
Run Code Online (Sandbox Code Playgroud)

使用:

ssh -T git@github.com
Run Code Online (Sandbox Code Playgroud)

我能够验证我的 ssh 密钥是否有效。我不知道发生了什么。这只是前几天工作。我已经几个月没有碰过这些设置了。所有这些都是在 Mac 上使用终端。

帮助!

Ped*_*ñoz 7

对我来说,以下内容始终适用于 GitHub 推送:

eval `ssh-agent -s`; ssh-add your_key; git push
Run Code Online (Sandbox Code Playgroud)


小智 6

您提到您使用的是 OSX。如果您使用的是 10.12.2+,则 ssh 配置可能有问题。Github 的文档对此有说明。

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

具体来说,他们说将以下内容添加到 ~/.ssh/config

Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa

希望这可以帮助


sas*_*uds 5

您的密钥可能已经链接到一个 repo

尝试使用ssh -T -ai ~/.ssh/id_rsa git@github.com 来查找相关的 repo。

这里的所有详细信息 https://help.github.com/en/articles/error-key-already-in-use

  • 输出将类似于: $ ssh -T -ai /home/user/.ssh/id_rsa git@github.com; 嗨 <github-用户名>/<repo-name>!您已成功通过身份验证,但 GitHub 不提供 shell 访问权限。 (2认同)