I received the following message when accessing my Git repo:
git clone git@github.com:patelc75/gitrepo.git
Initialized empty Git repository in /home/webuser/.ssh/gitrepo/.git/
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Then I did the following to debug

Use SSH With Verbose Output To Debug:

ssh -v git@github.com

And found out the permissions of the ssh key was the problem. The following fixed the problem.

Modify Permissions On Public SSH Key:

sudo chmod 644 id_rsa.pub


List Price: $34.99 USD
New From: $18.99 USD In Stock
Used from: $0.07 USD In Stock

UNIX and Linux System Administration Handbook (4th Edition) (Paperback)

By (author): Evi Nemeth, Garth Snyder, Trent R. Hein, Ben Whaley


List Price: $74.99 USD
New From: $48.38 USD In Stock
Used from: $39.22 USD In Stock

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , , , , , , , ,
3 Responses to ““Permission denied (publickey)” when accessing Github”
  1. Alessandro says:

    Thanks!
    After hours trying solve this issue, I found your article and it’s solved.

    [Reply]

  2. Deepd says:

    Been tnnikhig about doing it for a number of my project that I have currently on SVN, and on my own server. Any reason you picked git over say something like mercurial?

    [Reply]

  3.  
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.

*