Reputation: 155
On a VPS I can login using
ssh [email protected]
I have created a bare repository in:
/var/repo/site.git
which has:
drwxr-xr-x 7 root root 119 Jan 31 13:35 site.git
Locally I set up:
git remote add production ssh://[email protected]/../../var/repo/site.git
But when I try tyo push I get this error:
PS D:\path\site-directory> git push production master
[email protected]'s password:
Enumerating objects: 1152, done.
Counting objects: 100% (1152/1152), done.
Delta compression using up to 8 threads
Compressing objects: 100% (1073/1073), done.
remote: fatal: Unable to create temporary file '/var/repo/site.git/./objects/pack/tmp_pack_XXXXXX': Permission denied
fatal: sha1 file '<stdout>' write error: Broken pipe
error: remote unpack failed: index-pack abnormal exit
To ssh://server.com/../../var/repo/site.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'ssh://server.com/../../var/repo/site.git'
I think that I have to adjust some permissions, or I may have set up the wrong path.
Can anyone help me figure out how to troubleshoot?
Upvotes: 0
Views: 54
Reputation: 25239
This directory:
drwxr-xr-x 7 root root 119 Jan 31 13:35 site.git
Has a user ownership set to root. Since admin is not the owner of the directory, Linux next checks if the directory is world-writable, which it is not, so it denies access.
The simplest way to solve this is to make admin the owner of this directory.
Run this command:
sudo chown -R admin:admin /var/repo/site.git
Upvotes: 1