Permissions: Difference between revisions

No edit summary
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
 
Line 11: Line 11:


=== Implementation Details ===
=== Implementation Details ===
<source lang="bash">
<syntaxhighlight lang="bash">
# set groups and memberships
# set groups and memberships
sudo groupadd developers
sudo groupadd developers
Line 28: Line 28:
# restart apache so that it gets it's new group membership
# restart apache so that it gets it's new group membership
sudo apache2ctl restart
sudo apache2ctl restart
</source>
</syntaxhighlight>
== Fixing Permissions ==
== Fixing Permissions ==


<source lang="bash">
<syntaxhighlight lang="bash">


# find files that are executable and remove the execute bit
# find files that are executable and remove the execute bit
Line 52: Line 52:
# find directories without the group sticky bit set
# find directories without the group sticky bit set
sudo find . -type d ! -perm -g=s -ls
sudo find . -type d ! -perm -g=s -ls
</source>
</syntaxhighlight>


=== Fix permissions on your Drupal site ===
=== Fix permissions on your Drupal site ===
<source lang="bash">
<syntaxhighlight lang="bash">
DROOT='/var/www/example.com/www/drupal'
DROOT='/var/www/example.com/www/drupal'
USER=greg
USER=greg
Line 64: Line 64:
sudo find $DROOT/sites -type d -name files -exec chmod ug=rwx,o= '{}' \;
sudo find $DROOT/sites -type d -name files -exec chmod ug=rwx,o= '{}' \;
for d in "$DROOT/sites/*/files"; do sudo find $d -type d -exec chmod ug=rwx,o= {} \; ; find $d -type f -exec chmod ug=rw,o= {} \; ; done
for d in "$DROOT/sites/*/files"; do sudo find $d -type d -exec chmod ug=rwx,o= {} \; ; find $d -type f -exec chmod ug=rw,o= {} \; ; done
</source>
</syntaxhighlight>
The above script is explained at https://www.drupal.org/node/244924
The above script is explained at https://www.drupal.org/node/244924