I can\'t login to github with generated ssh-keys. I\'ve followed this manual: http://help.github.com/linux-key-setup but at step:
ssh git@github.com
<
I was able to get gitlab working thanks to this thread (I know that's not github).
I too found the answer by @jamesw to be correct.
I ended up having to delete my known_hosts
file and recreate my ssh key with the same password as my gitlab account.
Then I did the ssh-add
and did a git push -u origin master
. Success!
Thanks for the help everyone.
UPDATE:
I decided to remake my ssh key without a password and ran into this error again.
This time, I was able to copy my old known_hosts
to the new .ssh/
and simply run the ssh-add
.
Above Accepted solution did not work for me, but this worked http://ripan27.wordpress.com/2010/04/01/ssh-gitgithub-com-agent-admitted-failure-to-sign-using-the-key-permission-denied-publickey/
From the troubleshooting guide:
Permission denied (publickey)
This is usually caused when ssh cannot find your keys. Make sure your key is in the default location, ~/.ssh. If you run ssh-keygen again and just press enter at all 3 prompts it will be placed here automatically. Then you can add the contents of id_rsa.pub to my github keys. If id_rsa.pub doesn’t work try id_dsa.pub. You might need to generate a new dsa key with ssh-keygen -t dsa if you just have an rsa key.
If you are still having problems and none of the above worked, you may have a blacklisted key from a debian open-ssh bug. you should update open-ssh and re-generate your keys.
So, just to check - are your keys available under ~/.ssh/ as id_rsa and id_rsa.pub or otherwise, are you specifying their use?
I found this which helped me greatly http://playwithrubyandrails.blogspot.com/2011/04/process-for-deploying-app-on-heroku.html
ssh-add ~/.ssh/id_rsa
solved my problem after generating the relevant keys
Note that ssh-agent
is per session (per terminal). Use ssh agent manager like keychain (see its documentation on how to set it up) to have access via any session (from any term).
I encounterded same error when I copied id_rsa and idrsa.pub from another os. These files were 644 permission. So I changed it to 600. the error was fixed.