Skip to content

Instantly share code, notes, and snippets.

@scottalan
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottalan/8695252 to your computer and use it in GitHub Desktop.
Save scottalan/8695252 to your computer and use it in GitHub Desktop.
Drupal file permissions

For this I added my user to the www-data group: sudo usermod -a -g www-data your_user

I also changed the umask for my user in ~/.profile: umask 027

Change user:group for entire file system: sudo chown -R your_user:www-data drupal_root

On Drupal root run:

sudo find drupal_root -type d -exec chmod -R 2750 {} \;
sudo find public -type f -exec chmod -R 640 {} \;

Change settings.php: chmod 440 settings.php

Change the files directory so when files are created they use your_user:www-data:

sudo find files -type d -exec chmod -R 6770 {} \;
sudo find files -type f -exec chmod -R 640 {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment