-1

I've have been trying to push to origin master, and I was getting different errors now I'm getting this

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.

How can I connect my github again? I've tryed multiple different stuff.

  • 1
    did you get your certificates correctly set up on github and then on the client machine where you are pushing from? – eftshift0 May 30 '19 at 14:04
  • May you edit the question with the output of `ssh -Tv github.com`? – evolutionxbox May 30 '19 at 14:07
  • Possible duplicate of [GitHub Error Message - Permission denied (publickey)](https://stackoverflow.com/questions/12940626/github-error-message-permission-denied-publickey) – phd May 30 '19 at 15:16
  • https://stackoverflow.com/search?q=%5Bgithub%5D+Permission+denied+publickey – phd May 30 '19 at 15:17

1 Answers1

1

You need to have a SSH key on your machine generated if not already generated.

This can be done by running following command in your .ssh folder

ssh-keygen -t ecdsa -b 521 -f 'filepath/id_ecdsa'

More reading on ssh command.

This will generate a public and private key pair. You need the public key added to your github account added or for a specific repo.

cat id_ecdsa.pub and get it added to your github repo's SSH keys.

Note that the name of file above can be anything. I just named it after the encryption type ecdsa preferable.

HalfWebDev
  • 7,022
  • 12
  • 65
  • 103