Home > OS >  git hub Permission denied (publickey), but only for one respository
git hub Permission denied (publickey), but only for one respository

Time:01-10

I have many repositories(sites) within my github account, I used 2 different ones today, making branches, pushing merging..

I went to a third repository today (still within my git account like other 2). and I get

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The repository exists

I used 2 other from same account with last hour and still can even now. They all have exact same persmissions

Why is only one site giving me this error and how can I fix?

I tried cloning it fresh, but it wont let me clone.

I have multiple SSH keys, could it be possible that one repository is using one, and the rest use the other (even thought I never configured them this way, but this site is oldest)? Both keys are saved in github config

CodePudding user response:

Try with:

git -c core.sshCommand "ssh -Tv" clone [email protected]:me/myThirdRepo

You will see which key is used by default.

If it is not the right key, you would need a ~/.ssh/config file (as seen here) to reference the right private key.

CodePudding user response:

Github support got back to me (i had to pay them).

They recommend you use this in /.ssh/config, despite their help docs saying something else. Anyway, it worked

Host github.com *.github.net *.githubapp.com
  ForwardAgent no
  User yourusename
  IdentityFile ~/.ssh/id_ed25519
  • Related