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.
I was getting same error during 'git push'. In client side I had two origin and master. I removed one, then it worked fine.
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.
Did you create a config file in your ~/.ssh directory? It should have contents like these:
Assuming that you created an ssh key named github_rsa
and uploaded it to GitHub...
NOTE: You must follow this way of explicit configuration if you have more than 1 key (2 and more) in your ~/.ssh/ directory. If you don't specify key this way, then first key in order is taken and used for github authentication, so it depends on the key file name then.
I think i have the best answer for you, your git apps read your id_rsa.pub in root user directory
That's why your key in /home/your_username/.ssh/id_rsa.pub can't be read by git. So you need to create the key in /home/root/.ssh/
Then copy the key in your github account. It's worked for me. You can try it.
I had the same issue recently. This might help if you need a fix immediately, but this needs to be done every time you re-start your system
From terminal, run :
ssh-add ~/.ssh/id_rsa
Enter your system password and that should work.
Use the URL for this page when adding GitHub as a remote. it wont cause any such error and push the code