Skip to content

Instantly share code, notes, and snippets.

@earvinpiamonte
Last active September 2, 2019 14:39
Show Gist options
  • Save earvinpiamonte/740d5b2440dd4bed33f07b55eaaa22b3 to your computer and use it in GitHub Desktop.
Save earvinpiamonte/740d5b2440dd4bed33f07b55eaaa22b3 to your computer and use it in GitHub Desktop.
Add Linux user to www-data group. Fix unable to edit files under /var/www/html/
# Add the current user to www-data group
sudo usermod -a -G www-data $USER
# Change the group of web server directory to www-data
sudo chgrp -R www-data /var/www/html
# Give write permission to the www-data group
sudo chmod -R g+w /var/www/html
# You may need to restart
# reboot
# References:
# https://www.digitalocean.com/community/questions/why-doesn-t-chown-r-root-www-data-work-on-my-wordpress-installation#answer_23969
# https://www.washington.edu/computing/unix/permissions.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment