contact Me

Email me using the form to the right, or send me a message on twitter @kvangork

Modesto, California
United States

GitHub "Permission Denied (publickey)" Error Workaround

This frustrated me for 45 minutes tonight, and hopefully this post can save someone else from similar pain.

[MyRepo (master)]$ git push origin master Permission denied (publickey). fatal: The remote end hung up unexpectedly

I followed all the instructions at and and verified my connection was working via the ssh command, but kept receiving the Permission Denied (publickey) error when trying to push to github. Eventually I stumbled onto a workaround. In your local repository, remove and re-add the remote link. These commands worked for me, but YMMV:

git remote rm origin git remote add origin <remote url>

Replace the remote url with your github clone url (looks like<username>/<reponame>.git) and try your push again.