I don't want to lock down everything, since I need the built FTP uploader and caching programs to work correctly on the WordPress sites.

This is what I have found:

Folders - 755

Files - 644

wp-config.php - 444

I'm a little rusty on the SSH commands. Will the following accomplish the files and folders permissions?

sudo chmod -d 755 /var/www/directory

sudo chmod -f 644 /var/www/directory

They do not look right to me.


Set permissions on directories:

find /var/www/directory -type d -exec chmod 755 {} \;

Set permissions on files:

find /var/www/directory -type f -exec chmod 644 {} \;

Set the permission for wp-config.php:

chmod 444 wp-config.php

chmod does not have a -d flag, and the -f flag is to suppress error messages.

Also, for WordPress to have automatic updates and all that good stuff, make sure the files are owned or writable by the web server OR PHP (If using PHP-FPM/HHVM).

At the very least, the /wp-content/uploads and /wp-content/upgrade folder should be writable by the web server/PHP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.