Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Error Message - Permission denied (publickey)

Tags:

git

github

Anybody seen this error and know what to do?

I'm using the terminal, I'm in the root, the GitHub repository exists and I don't know what to do now.

> git push -u origin master Permission denied (publickey). fatal: Could not read from remote repository.  Please make sure you have the correct access rights and the repository exists. 
like image 967
webwrks Avatar asked Oct 17 '12 18:10

webwrks


People also ask

How do I fix Permission denied in GitHub?

Always use the "git" user$ ssh -T [email protected] > Permission denied (publickey). If your connection failed and you're using a remote URL with your GitHub username, you can change the remote URL to use the "git" user. You should verify your connection by typing: $ ssh -T [email protected] > Hi username!

How do I fix SSH permission denied publickey?

If you want to use a password to access the SSH server, a solution for fixing the Permission denied error is to enable password login in the sshd_config file. In the file, find the PasswordAuthentication line and make sure it ends with yes . Find the ChallengeResponseAuthentication option and disable it by adding no .

How do I fix Git GitHub Permission denied publickey fatal could not read from remote repository?

The “Permission denied (publickey). fatal: Could not read from remote repository” error is caused by an issue with the way in which you authenticate with a Git repository. To solve this error, make sure your key is being used on your Git account. If it is not, add your key to Git.


2 Answers

GitHub isn't able to authenticate you. So, either you aren't setup with an SSH key, because you haven't set one up on your machine, or your key isn't associated with your GitHub account.

You can also use the HTTPS URL instead of the SSH/git URL to avoid having to deal with SSH keys. This is GitHub's recommended method.

Further, GitHub has a help page specifically for that error message, and explains in more detail everything you could check.

like image 96
bdukes Avatar answered Oct 08 '22 03:10

bdukes


I know about this problem. After add ssh key, add you ssh key to ssh agent too (from official docs)

ssh-agent -s ssh-add ~/.ssh/id_rsa 

After it all work fine, git can view proper key, before couldn't.

like image 35
VelikiiNehochuha Avatar answered Oct 08 '22 03:10

VelikiiNehochuha