Copy files from one user to another permissions issue
I have a user ‘git‘ that owns a git repository. I’m trying to setup a post-update hook that copies the files in the repository to /var/www/site/. I’m still getting a hang of users and permissions in linux, what is the best scheme for this situation?
One Solution collect form web for “Copy files from one user to another permissions issue”
You could either have git own
/var/www/site/, and give it 660 permissions on it (read and write, no execute), or make
/var/www/site/ world writeable (which is not entirely a good idea, as then any user can copy, edit, etc. files in
chown could help you change the owner, and
chmod can help you change file permissions.
You can also add git to the group who owns
/var/www/site/, and make sure that the group has read/write permissions on
/var/www/site/ as well.
And if you ever need help with chown, chmod, or any other linux command,
man can help you out.