Created
September 26, 2016 16:07
-
-
Save sl-digital/8c37f9b87073974b7dc03db29df50b23 to your computer and use it in GitHub Desktop.
Webroot File Permissions
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
# Let Apache be initial owner | |
chown -R www-data:www-data /var/www/html | |
# Create an admin user | |
adduser admin | |
usermod -a -G sudo admin | |
usermod -a -G www-data admin | |
# Create a deployment user | |
adduser deployer | |
usermod -a -G www-data deployer | |
# Check the current ACLs | |
getfacl /var/www/html | |
# Set default ACL for admin user and www-data group | |
setfacl -Rd -m u:admin:rwx /var/www/html | |
setfacl -Rd -m g:www-data:rwx /var/www/html | |
# Set ACL for admin user and www-data group | |
setfacl -R -m u:admin:rwx /var/www/html | |
setfacl -R -m g:www-data:rwx /var/www/html | |
# Set default group for new content | |
chmod -R g+s /var/www/html | |
# Change folder permissions to rwxr-xr-x | |
find . -type d -exec chmod 755 {} \; | |
# Change file permissions to rw-r--r-- | |
find . -type f -exec chmod 644 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment