Skip to content

Instantly share code, notes, and snippets.

@max2320
Created February 16, 2016 12:56
Show Gist options
  • Save max2320/c735a356421b3c68f0bf to your computer and use it in GitHub Desktop.
Save max2320/c735a356421b3c68f0bf to your computer and use it in GitHub Desktop.
This bash function improve security for your wp on aws
// usage wp-permission-fix <wp dir>
wp-permissions-fix(){
sudo chown -R ubuntu:www-data $1
sudo find $1 -type d -exec chmod 755 {} \;
sudo find $1 -type f -exec chmod 644 {} \;
sudo find $1/wp-content/uploads/ -type d -exec chmod 775 {} \;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment