简体   繁体   English

git push origin master拒绝错误权限(github)

[英]git push origin master gives error permission denied (github)

ERROR: Permission to durrantm/linker.git denied to kevinzen. 错误:durrantm / linker.git的权限被拒绝给kevinzen。 fatal: The remote end hung up unexpectedly 致命:远程端意外挂断

I've tried a lot of things to change/set my identity and get rid of that 'kevinzen' 我已经尝试了很多改变/设置我的身份并摆脱'kevinzen'的事情

Update - final resolution was that I had added my public key... but... I had missed a few characters so it was invalid. 更新 - 最终决议是我添加了我的公钥......但是......我错过了几个字符,所以它无效。 Pasting in the correct key on github fixed it 在github上粘贴正确的密钥修复它

I have ~/.ssh/ with files 我有~/.ssh/文件

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

I have done 我已经做好了

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

I have added my local ssh key with my info (not kevinz) for this machine to github ssh keys. 我已将本地ssh密钥与我的信息(不是kevinz)添加到github ssh密钥。

I also tried: 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 我也尝试过: 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 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

wasn't sure about the PTY error. 不确定PTY错误。 Still stuck. 仍然卡住了。

Did you install your key at GitHub? 你在GitHub上安装了密钥吗? Have you read help section there? 你在那里看过帮助部分吗?

You can list your own keys as saved at GitHub by: 你可以列出你自己的密钥保存在GitHub上

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

Have you checked that one of the keys is a match to one of your keys? 您是否检查过其中一个键是否与其中一个键匹配? Compare: 相比:

cat ~/.ssh/id_*.pub

I had the same problem, my solution was simple. 我有同样的问题,我的解决方案很简单。 I already have my keys setup and everything and kept trying to run: 我已经设置了密钥,并且一直在尝试运行:

git config --global user.name IceMupppet

After looking through my ~/.ssh/ I noticed that running: 看完我的〜/ .ssh后,我注意到了跑步:

ssh-add -l

I saw that to simply use the right git account I just added the right file: 我看到只是使用正确的git帐户我刚刚添加了正确的文件:

ssh-add ~/.ssh/id_IceMupppet_rsa

... then a git push origin master worked fine. ...然后git push origin master工作得很好。 I have an alias on my ssh config to use different keys for my work and personal, but still had to do this step for some reason. 我在我的ssh配置上有一个别名,可以为我的工作和个人使用不同的密钥,但由于某种原因仍然需要执行此步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM