I created a fresh repo, was able to clone with SSH and commit and everything. But when I try to push I get the following error:
ERROR: Permission to Ronin11/MealPlanr.git denied to deploy key
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
Using:
ssh -T [email protected]
I was able to verify that my ssh key is working. I have no idea what happened. This was just working the other day. I haven't touched these settings in months. All this was using the terminal on Mac.
Help!
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!
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 .
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.
It's possible that your key is already linked to one repo.
Try to use ssh -T -ai ~/.ssh/id_rsa [email protected]
to find the concerned repo.
All details here https://help.github.com/en/articles/error-key-already-in-use
For me the following always works for GitHub push:
eval `ssh-agent -s`; ssh-add your_key; git push
You mentioned you were using OSX. If you're on 10.12.2+ it may be a problem with your ssh config. Github's documentation has a note about that.
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
Specifically they say add the following to ~/.ssh/config
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With