Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@UltimateByte
Last active August 20, 2016 16:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UltimateByte/58281d4593665b77185593673bc234cf to your computer and use it in GitHub Desktop.
Save UltimateByte/58281d4593665b77185593673bc234cf to your computer and use it in GitHub Desktop.
# 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