I have connected many times to github and know about generating ssh keys and putting the id_rsa.pub
into github settings. But for some reason with this install I can not get it to connect. I am just trying to clone a private repo to a new server but when I the clone I get :
Permission denied (publickey). fatal: The remote end hung up
unexpectedly
If I run :
ssh -T git@github.com
It tells me I have successfully authenticated.
What else can I try? I am running this on a bitnami stack so maybe that is causing issues? This is probably the problem, I just am not sure what to do about it. There are already a set of keys in the .ssh/authorized_keys dir. I left those alone as this is how I am connecting with putty/pagent. I put the new keys in /.ssh and left the authorized_keys alone. What would be the correct way to set this up? Should I just delete both pairs and start over? Use the same keys for putty and github? Why do I still authenticate if there is a problem?
Best Answer
Have you tried creating a new SSH certificate, i.e. key pair?
1 Generate default key pair:
Don't use this if you already have an SSH certificate.
2 Generate additional key pairs:
3 Add non-default keys
4 Set SSH configuration file (
~/.ssh/config
) so SSH knows which key to be used for which server:5 Make sure in the
.git/config
file for the Git project associated with the second user account at Github that you are using correct host namegithub-client
but notgithub.com
: