Last active
August 20, 2016 16:53
-
-
Save UltimateByte/58281d4593665b77185593673bc234cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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