Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github SSH Permission denied to deploy key

Tags:

git

ssh

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!

like image 774
Ronin Avatar asked Mar 27 '17 18:03

Ronin


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 resolve permission denied public key?

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


3 Answers

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

like image 101
sashaboulouds Avatar answered Oct 26 '22 09:10

sashaboulouds


For me the following always works for GitHub push:

eval `ssh-agent -s`; ssh-add your_key; git push
like image 43
Pedro Muñoz Avatar answered Oct 26 '22 10:10

Pedro Muñoz


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

like image 34
Derek Hunter Avatar answered Oct 26 '22 09:10

Derek Hunter