Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

socieboy's avatar

Github SSH Deploy

Hi I'm having some problems with Github trying to deploy a private repository to my server. I got the following error:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I know "what the issue is" but i have already generated my ssh key added to GitHub ssh keys and still getting this error. I follow Github documentation in order to generate the key for Linux:

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#platform-linux

I currently use HTTPS but i need to enter the password and all that stuff... I don't want a password.

0 likes
2 replies
Cronix's avatar

And you did the "Adding your SSH key to the ssh-agent" step?

1 like
socieboy's avatar
socieboy
OP
Best Answer
Level 14

@Cronix yes i did everything, but also i found the issue, i had permissions to www-data to the project folder. i didn't know that this could be issue with github.

Please or to participate in this conversation.