开发者

git push origin master gives error permission denied (github)

开发者 https://www.devze.com 2023-04-02 23:13 出处:网络
ERROR: Permission to durrantm/linker.git denied to kevinzen. fatal: The remote end hung up unexpectedly

ERROR: Permission to durrantm/linker.git denied to 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'

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

I have ~/.ssh/ with files

  • 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.

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

wasn't sure about the PTY error. Still stuck.


Did you install your key at GitHub? Have you read help section there?

  • https://help.github.com/articles/reviewing-your-ssh-keys/
  • https://github.com/settings/keys

You can list your own keys as saved at GitHub by:

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-add -l

I saw that to simply use the right git account I just added the right file:

ssh-add ~/.ssh/id_IceMupppet_rsa

... then a git push origin master worked fine. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号