Skip to content

Instantly share code, notes, and snippets.

@ssv445
Created April 23, 2014 06:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssv445/11204300 to your computer and use it in GitHub Desktop.
Save ssv445/11204300 to your computer and use it in GitHub Desktop.
Setup file permission in Joomla CMS
#!/bin/bash
pwd=${PWD}
[[ $pwd =~ ^/var/www* ]] || exit 0
echo 'PWD is subdirectory of /var/www, applying permissions ...'
find . -exec chown www-data:www-data {} \;
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
#-- add up extra security after testing
#-- remove all groups/others permission
#sudo chmod -R go-rwx .
#-- permit only group to RW
#sudo chmod -R g+rw .
#-- other only can read
#sudo chmod -R o+r .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment