Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull failed - permission denied #37

Open
mlingelbach opened this issue Oct 19, 2019 · 2 comments
Open

Pull failed - permission denied #37

mlingelbach opened this issue Oct 19, 2019 · 2 comments

Comments

@mlingelbach
Copy link

Hi,

I am getting this error, when call "git pull" from script:

=== ERROR: Pull failed using GIT /usr/bin/git and DIR /home/****/public_html/test.****.de/ ===
Permission denied (publickey).
fatal: Could not read from remote repository.

But when I execute "git pull" via ssh console, I dont get this error and the pull will execute.

I checked the user calling the script. It's the same user I'm signed in with via ssh.

Has anyone an idea?

@rafmaghari
Copy link

have you solve this problem ?

@Smartay
Copy link

Smartay commented Jan 31, 2021

Open a terminal window and cd to the repository dir then run (Hidden files are not included in the original change to update the repo dir) Also confirm the SSH key has been added into the git provider of choice e.g. gitlab > user > SSH Keys
sudo chown -R www-data:www-data .git
sudo chmod -R g+s .git
sudo chmod -R 775 .git
Also as a side not just incase you could also try
sudo service ssh restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants