Last active
July 31, 2019 05:56
-
-
Save yukal/c584f960d6a0e3e0b79c7710b7cf5fc0 to your computer and use it in GitHub Desktop.
Create a system account www-data with the same UID and GID
This file contains 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
# Create www-data account | |
useradd -s /sbin/nologin -d /var/www -r -M -U -u 777 www-data | |
# Set the ownership to www directory | |
# chown -R root:www-data /var/www | |
chown -R www-data:www-data /var/www | |
# Set permissions of child files and directories inside the www directory | |
find /var/www -type d -exec chmod 2775 {} + | |
find /var/www -type f -exec chmod 0664 {} + | |
# Append nginx user to www-data group | |
usermod -aG www-data nginx | |
# Append mysql user to www-data group | |
usermod -aG www-data mysql | |
# Check info | |
id www-data && id nginx && id mysql | |
ls -la /var | grep www-data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment