Question: My wp-content folder has owner `User` and group `www-data`. The permissions are 775 for folders and 664 for files, so the server can write inside the folder. 

But when the server creates folder and files inside wp-content ( when installing theme ), they have the server as owner ( and the server's primary group ) and they get 755 for folder and 644 for files. 

So I can't keep all folders and files of a WordPress installation under `User` ownership.

How can I make all newly created folders and files created by server inside `wp-content` inherit the ones that the parent folder has?

Thank you.

Answer: 
If you care about security you should not install themes and plugins from the wordpress admin. Either install them by uploading via FTP or use WP-CLI for that.

There is just no way to change file owners when the script is running in the context of the web server, therefor the only way to maintain reasonable file permissions is to avoid uploading code from the admin.
I've had this problem because I host a few Wordpress sites on a few servers. Apache should own everything because Wordpress creates folders and files as it runs. If you want the user to make changes to Wordpress files then add the user to the group apache and change the permissions to 775.