Skip to content

Instantly share code, notes, and snippets.

@ssv445 ssv445/setperm.sh
Created Apr 23, 2014

Embed
What would you like to do?
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
You can’t perform that action at this time.