Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$ ssh -T git@github - permission denied (public key)

I'm first time GitHub user. I installed Git for Windows, following instructions: http://help.github.com/win-set-up-git/

Came to the point of generating a public ssh-key. Opened Git Bash. Generated the key, saved it on github.com in my SSH Public Keys, now trying ssh access:

$ ssh -T [email protected]
Permission denied (publickey).

What's wrong? The instruction sais that everything should go fine. Maybe I need to reboot or wait when github.com server gets to know my key?

Please help.

Thanks in advance!

like image 814
Michael Zelensky Avatar asked Sep 26 '11 11:09

Michael Zelensky


4 Answers

You need to set up your ssh keys and then add your public key to your github account

like image 118
c00kiemon5ter Avatar answered Jan 01 '23 22:01

c00kiemon5ter


    ssh-keygen -t rsa
    copy the key generated in the file ~/.ssh/id_rsa.pub (open with notepad)
    paste this key in the "add ssh key" section of your github account
like image 25
Srinivas Kattimani Avatar answered Jan 01 '23 21:01

Srinivas Kattimani


I had the same problem. Although every instruction was followed; Public Key genereated and added to my Github account, i kept getting the error...Until i restarted my machine. I suggest you do the same. Hopefully this should fix it.

like image 26
dade Avatar answered Jan 01 '23 23:01

dade


Had to use exec ssh-agent bash. It helped:

$ exec ssh-agent bash
bash-3.1$ ssh-add f:/GIT/.ssh/id_rsa
Enter passphrase for f:/GIT/.ssh/id_rsa:
Identity added: f:/GIT/.ssh/id_rsa (f:/GIT/.ssh/id_rsa)
bash-3.1$ ssh [email protected]
Hi MichaelZelensky! You've successfully authenticated, but GitHub does not provi
de shell access.
Connection to github.com closed.
like image 26
Michael Zelensky Avatar answered Jan 01 '23 21:01

Michael Zelensky