1

I've recently been trying to get into the habit of using git to push my repositories and commits to Github, rather than using manual file uploads, so that I can start practicing with Git. However, in the past week I've started getting the following error message any time I try to push to one of my Github Repositories. I've recieved the following error message while trying to upload three different repositories in the last week.

git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

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

I'm pretty new to Git, so I'm not sure what my next steps should be to trouble shoot this issue. I did read in a different thread that I should try "ssh -T git@github.com" and when I run that command I get the following response:

git@github.com: Permission denied (publickey).

David Reke
  • 535
  • 1
  • 5
  • 20

2 Answers2

1

It looks like your SSK key has not been configured on Github. Checkout their super helpful guide here: https://help.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh

You will need to go to Settings in the upper right corner of Github. Navigate to SSH and GPG keys, and click "New SSH Key". Here you will need to paste in a copy of your public key.

After all that, you will be good to go! Try running ssh -T git@github.com again, and see if Github recognizes your user name!

Ryan
  • 160
  • 12
1

You should generate an SSH key in case you haven't done so yet. More information about generating an SSH key can be found here: https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

When you have successfuly created your SSH public and private keys you should add your public SSH key to your github profile. More information on how to do this can be found here. https://help.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account

This way github knows who you are and is able to authenticate your account.

Thom
  • 111
  • 1
  • 3