Configuring default inheritance of permissions for new directories and files

1

I have some WordPress websites which have a good set of permissions on it. The problem I'm having is that WordPress is creating new folders (for example for plugins) which have a different set of user/groups:

ls -la /var/www/zorg.outsideit.net/public_html/wp-content/plugins
total 56
drwxrwxr--+  7 myuser g_w_zorg.outsideit.net 4096 Oct 26 22:46 .
drwxrwxr-x   7 myuser g_w_zorg.outsideit.net 4096 Oct 26 19:57 ..
drwxrwxr--+  4 myuser g_w_zorg.outsideit.net 4096 Oct 17 19:36 better-wp-security
drwxrwxr--+  5 myuser g_w_zorg.outsideit.net 4096 Sep 27 21:36 gzip-ninja-speed-compression
-rw-rwxr--+  1 myuser g_w_zorg.outsideit.net   28 Sep 23 20:41 index.php
drwxrwxr--+  6 myuser g_w_zorg.outsideit.net 4096 Sep 27 21:35 stops-core-theme-and-plugin-updates
drwxr-xr-x+  4 apache   apache                 4096 Oct 26 22:44 theme-check
drwxrwxr--+ 11 myuser g_w_zorg.outsideit.net 4096 Oct 20 15:42 wordpress-seo

As you can se the theme-check plugin has apache:apache instead of myuser:g_w_zorg.outsideit.net

I'm looking for a way so new files and folders created always get myuser:g_w_zorg.outsideit.net as user and group.

I played around with the s bit, but it seems this only works for files, not for folder or subfolders.

So I had a look at setfacl and tried:

sudo setfacl -Rdm u:myuser:rwx /var/www/zorg.outsideit.net/public_html/wp-content/plugins
sudo setfacl -Rm u:myuser:rwx /var/www/zorg.outsideit.net/public_html/wp-content/plugins

But newly uploaded plugins still don't inherit the myuser:g_w_zorg.outsideit.net user and owner.

Any advice to achieve true inheritance of owner, group and permissions for files, folders and subfolders is appreciated.

willemdh

Posted 2016-10-26T21:05:20.717

Reputation: 123

You are asking an off-topic question. See On Topic. Questions about wordpress.com belong on [WebApps.SE]. Questions about installing and maintaining WordPress belong on [WordPress.SE]

– DavidPostill – 2016-10-26T21:39:27.597

imho this is a question about setfacl and ways to enforce permission inheritance. This could be related to any type of application or folder structure. – willemdh – 2016-10-27T21:53:36.087

True, but in this particular case it is wordpress that is messing up the permissions. – DavidPostill – 2016-10-27T21:55:15.470

No answers