Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git push origin Permission to * denied fatal: Could not read from remote repository

Tags:

git

github

So I have my public ssh key added to the git repo. I have the private key added to my /c/Users/totty/.ssh/.

When I run ssh -vT [email protected] it says Hi X! You've successfully authenticated, but GitHub does not provide shell access.

When I run git push origin I get Permission to * denied fatal: Could not read from remote repository

What is wrong with this github? I can't push from cmd, git extensions. But it works from github from windows...

After I remove my ssh keys and run ssh -vT [email protected] I get debug1: No more authentication methods to try..


Also another thing that is strange... if you look at the circled text, that's not my username or email anywhere. I even check in my git config and is nowhere. Where is coming from? I mean gs11118

enter image description here

like image 528
Totty.js Avatar asked Jun 22 '18 21:06

Totty.js


People also ask

How do I fix Permission denied in git?

In terminal enter this command with your ssh file name pbcopy < ~/. ssh/id_rsa. pub This will copy the file to your clipboard Now open you github account Go to Settings > SSH and GPG keys > New SSH key Enter title and paste the key from clipboard and save it. Voila you're done.

How do you fix fatal could not read from remote repository please make sure you have the correct access rights and the repository exists?

The Git “fatal: Could not read from remote repository” error occurs when there is an issue authenticating with a Git repository. This is common if you have incorrectly set up SSH authentication. To solve this error, make sure your SSH key is in your keychain and you connecting to a repository using the correct URL.

How do I fix error permission denied Publickey fatal could not read from remote repository GitHub?

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.


1 Answers

First, the username/email (the one you set with git config user.name / user.email) has nothing to do with GitHub credentials (a user GitHub account name)

Second, make sure your git push is actually using an SSH URL:

cd /path/to/my/local/repo
git remote -v

If you see an URL staring with https://..., it won't matter that ssh -T [email protected] does identifies you correctly: Git would not use that as credentials. It would use what is stored in the Windows Credentials Manager.

like image 140
VonC Avatar answered Oct 13 '22 04:10

VonC