Problem with SSH Key to connect to Github
1
Not solved Solved
9 months ago

Does anyone get this message on his Terminal ? "Enter passphrase for key '/Users/annalouis/.ssh/idrsa': Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.” I can’t access to any repository of my github account. I openend my .ssh/idrsa', I tried to reclone my repo and also tried my GitHub for Mac SSH key passphrase, none of them is working. . .

9 months ago

Hi,

Do you see your key when you write this in a terminal ? ssh-add -l

Do you try to clone your repo with ssh (not https) ? git clone git@github.com:blabla.git

Is your ssh key still added in your github ? (in settings > SSH and GPG keys)

9 months ago

Did you cycle your ssh key pair?

You could copy the public part of your key to github:

  • open your terminal, and copy the results of cat $HOME/.ssh/id_rsa.pub (that is a really long line starting with ssh-rsa AAA)
  • go to https://github.com/settings/keys
  • click 'New SSH key'
  • Type a memorable Title ( e.g. 'AnnaLouis On MacBook' or something like that)
  • Paste that long line into the 'Key' field

Then, in the terminal try to clone/fetch/pull/push again.

9 months ago

Okay Thanks a lot ! I had to delete my SSH Key on https://github.com/settings/keys, Create a new one and overwrite the first one (could'nt find the passphrase) with the command : $ ssh-keygen -t rsa
[Generating public/private rsa key pair.] [Enter file in which to save the key (/Users/annalouis/.ssh/id_rsa):][PRESS ENTER] [/Users/myname/.ssh/id_rsa already exists.] Overwrite (y/n)? y Enter passphrase (empty for no passphrase) : etc. . .

And then to add it to the ssh-agent : $ eval "$(ssh-agent -s)"

And added a new key on Github with the line generated by the command $ cat $HOME/.ssh/id_rsa.pub

Cancel
Submit your answer