here is a quick bash script that I use to fix the permissions in my wordpress directory structure.
#!/bin/sh shmoddy="/var/www/px.ns1.net/htdocs/" ## set some base permissions sudo chown -R px:apache $shmoddy sudo chmod -R g-rwx $shmoddy sudo chmod -R o-rwx $shmoddy ## find all directories find "$shmoddy" -type d -print0| xargs -r0 chmod 755 ## find all files find "$shmoddy" -type f -print0| xargs -r0 chmod 664 ## uncomment next 2 lines to make editing online work #sudo chmod -R g+rwx $shmoddy/wp-content/plugins #sudo chmod -R g+rwx $shmoddy/wp-content/themes ## needed for backup dir sudo chmod g+rwx $shmoddy/wp-content/backup-* ## find all the .htaccess files find "$shmoddy" -name .htaccess -print0| xargs -r0 chmod -RR g+r
[tags]blogs, software, wordpress, permissions, fix, bash_script[/tags]



