“Permission denied (publickey)” when accessing Github

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: $7.00 USD In Stock
Used from: $6.93 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.44 USD In Stock
Used from: $40.96 USD In Stock

Share