“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:

bash

  1. 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:

bash

  1. sudo chmod 644 id_rsa.pub

Version Control with Git: Powerful tools and techniques for collaborative software development (Paperback)


List Price: $34.99
New From: $12.50 USD In Stock
Used from: $2.70 USD In Stock

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


List Price: $74.99 USD
New From: $43.77 USD In Stock
Used from: $34.64 USD In Stock

Share