Skip to content

Instantly share code, notes, and snippets.

@lantrix
Last active November 30, 2018 10:32
Show Gist options
  • Select an option

  • Save lantrix/0abc3c286d82959dba0a9b291cf74bf0 to your computer and use it in GitHub Desktop.

Select an option

Save lantrix/0abc3c286d82959dba0a9b291cf74bf0 to your computer and use it in GitHub Desktop.
EE4 sites lockdown perms
mysftpuser="usernamehere"
adduser $mysftpuser www-data # Add SFTP user to www-data group
cd /opt/easyengine/sites/ # Change to EE Sites folder
for i in `ls`;
do
chmod 644 $i/app/wp-config.php # Default recommended from wordpress doco - https://codex.wordpress.org/Changing_File_Permissions#Example_Permission_Settings
chown -R www-data:www-data $i/app/htdocs # Ref https://wordpress.stackexchange.com/a/241310/4153
find -L $i/app/htdocs -type f |xargs -d '\n' chmod 744
find -L $i/app/htdocs -type d |xargs -d '\n' chmod 755
find -L $i/app/ -name .htaccess |xargs -d '\n' chmod 644 # Recommended https://codex.wordpress.org/Changing_File_Permissions#.htaccess_permissions
chmod -R 775 $i/app/htdocs/wp-content/ # WordPress writeable as the SFTP account, that account needs to have write access https://codex.wordpress.org/Changing_File_Permissions#Permission_Scheme_for_WordPress
chmod -v 666 $i/app/htdocs/.htaccess # If using permalinks change permissions of .htaccess to make sure that WordPress can update it https://codex.wordpress.org/Changing_File_Permissions#About_Chmod
done
docker exec -it ee-global-redis redis-cli FLUSHALL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment