1

I have hardened my Wordpress settings as follows:

  • All files/directories are owned by my user account (myUserName) and are group-owned by my web server (http) -- myUserName:http
  • All folders have 755 permissions, except 'wp-content' and its folder children which have 775 permissions
  • All files have 644 permissions, except files within wp-content which have 664 permissions
  • wp-config file has 640 permissions

The problem is that with the above settings, I cannot update anything from Wordpress (plugins, themes, etc). It first forces an FTP prompt rather than directly updating the files, and after entering my FTP user credentials it errors out (can't copy file, can't connect to __, and others...).

The only way I am able to get the site to update without an FTP prompt and also to update without any errors is by changing the ownership settings of the entire Wordpress directory and files to the user:group of the web server itself ('http:http').

  1. Isn't this a security risk to have the web server directly own the WP directory/files rather than simply allowing group ownership settings to extend rights to the web server (per my initial efforts)?
  2. Why do my group ownership settings not work? The entire site is group-owned by 'http' (which is both the user and group for my web server), and the permission settings for wp-content where these things get updated (775 for folders and 664 for files) give the web server read/write access
  3. If I temporarily grant the entire WP directory 777 permissions (I know this is bad, but just for testing's sake), then I still cannot get the web server to update files. It is ONLY when I actually change the direct ownership of the directory to that of the web server that is is capable of updating using the one-button update buttons on the wp-admin pages.

1 Answer 1

0

Your file and folder ownership seems fine at the beginning. Simply update your wp-config.php file with this line:

define('FS_METHOD', 'direct');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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