【问题标题】:git push origin master gives error permission denied (github)git push origin master 给出错误权限被拒绝(github)
【发布时间】:2011-09-07 12:15:39
【问题描述】:

错误:对 durrantm/linker.git 拒绝 kevinzen 的权限。 致命:远端意外挂断

我已经尝试了很多方法来改变/设置我的身份并摆脱那个“kevinzen”

更新 - 最终解决方案是我添加了我的公钥......但是......我错过了几个字符,所以它是无效的。在github上粘贴正确的密钥修复它

我有 ~/.ssh/ 的文件

  • config
  • id_dsa
  • id_dsa.pub
  • id_kb_rsa
  • id_kb_rsa.pub
  • id_rsa
  • id_rsa.pub
  • known_hosts

我已经完成了

git config --global user.name
git config --global user.email
git remote add origin git@github.com:durrantm/linker.git

我已将此机器的本地 ssh 密钥和我的信息(不是 kevinz)添加到 github ssh 密钥。

我也试过: ssh git@github.com. The authenticity of host 'github.com. (207.97.227.239)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com.' (RSA) to the list of known hosts. PTY allocation request failed on channel 0

不确定 PTY 错误。还是卡住了。

【问题讨论】:

  • 您的公钥是否在此处注册:github.com/account/ssh?你能再检查一下吗?
  • 你检查过~/.ssh 中的文件是否有提到kevinzen?
  • 我检查了文件和cat * | grep kevinzen,但没有找到。奇怪。
  • 我在 ssh'ing 到 git@github.com 时也出现 PTY 通道错误,但它把这条消息放在下面:Hi bgarret! You've successfully authenticated, but GitHub does not provide shell access.?我想你没有这个?
  • 另外,这有点牵强,但可能是 kevinzen 将您的 ssh 公钥添加到了他的帐户中......

标签: git ssh github key


【解决方案1】:

您是否在 GitHub 上安装了您的密钥?你读过那里的帮助部分吗?

您可以通过以下方式列出your own keys as saved at GitHub

curl https://github.com/<username>.keys

您是否检查过其中一个键与您的一个键匹配?比较:

cat ~/.ssh/id_*.pub

【讨论】:

  • 好问题。是的,我已将本地 ssh 密钥添加到 github,但问题仍然存在。
【解决方案2】:

我遇到了同样的问题,我的解决方案很简单。我已经设置好我的密钥和一切,并继续尝试运行:

git config --global user.name IceMupppet

查看我的 ~/.ssh/ 后,我注意到正在运行:

ssh-add -l

我看到,为了简单地使用正确的 git 帐户,我刚刚添加了正确的文件:

ssh-add ~/.ssh/id_IceMupppet_rsa

...然后git push origin master 工作正常。我的 ssh 配置中有一个别名,可以为我的工作和个人使用不同的密钥,但由于某种原因仍然必须执行此步骤。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-29
    • 2013-01-20
    • 2013-04-29
    • 2017-08-21
    • 2010-12-21
    • 2016-10-30
    • 2011-02-08
    相关资源
    最近更新 更多