WordPress file permissions for editing on local Ubuntu development machine

I’m too working on Ubuntu, personally I’m setting things up like this:

sudo chown -R nasser /path/to/your/wordpress/root/
sudo chgrp -R www-data /path/to/your/wordpress/root/
sudo chmod -R 775 /path/to/your/wordpress/root/

I only do this on my local development machine for convenience and a smoother work-flow. One more thing to note, I’ve moved the www directory into the home directory, symlinking from /var/www/ to /home/user/www/, which is convenient, but shouldn’t be necessary.

Do not forget to revert this back before deploying, for this do at the very least this:

sudo chown -R www-data /path/to/your/wordpress/root/
sudo chgrp -R www-data /path/to/your/wordpress/root/
// the last two lines can be combined like:
// sudo chown -R www-data:www-data /path/to/your/wordpress/root/
sudo find /path/to/your/wordpress/root/ -type f -print0 | xargs -0 sudo chmod 644
// the last line could also be done like this:
// sudo find /path/to/your/wordpress/root/ -type f -exec chmod {} 644 \;
sudo find /path/to/your/wordpress/root/ -type d -print0 | xargs -0 sudo chmod 755
// the last line could also be done like this:
// sudo find /path/to/your/wordpress/root/ -type d -exec chmod {} 755 \;
sudo chmod 600 /path/to/your/wordpress/root/wp-config.php

You might of course have other wishes for your file permissions, more about that in the codex articles Changing File Permissions and Hardening WordPress – File Permissions.