Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# This is targetted towards people using a user for each website.
# Give back its own files to your user
chown -R user:user ~user/public_html
# Copy user permissions to group permissions
chmod -R g=u ~user/public_html
# Disallow other users from everything on your files
chmod -R o-rwx ~user/public_html
# Add apache2 to your user's group
usermod -a -G user www-data
# check this is applied correctly
groups www-data
# Restart apache2
service apache2 restart
## If you need to revert a usermod
deluser user group
### Enjoy not needing to chmod again ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.