Github Permission Denied

I was trying to push to Github and got the following error:

debug1: No more authentication methods to try.
Permission denied (publickey).

In the above case make sure a new SSH key exists by checking there are files in ~/.ssh commonly named id_rsa and id_rsa.pub.

If not run:
ssh-keygen -t rsa -C "email@domain.com"
Replace the email address with your email address. Follow the on screen prompts.
Add the newly generated key:
ssh-add ~/.ssh/id_rsa

Run the following command to test the SSH Github connection:
ssh -T git@github.com

If the above doesn’t work check the pub key has been added on Github. This can be found in the settings page and paste the exact contents in ~/.ssh/id_rsa.pub

Error: Permission denied (publickey)

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in Linux, SCM and tagged , , , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.