I have an Ubuntu 16.04 Nginx server environment with several (WordPress) webapps under /var/www/html
.
My Nginx user is www-data
.
Each time I add A webapp, I execute:
chown www-data:www-data /var/www/html/* -R
find /var/www/html/* -type d -exec chmod 755 {} \;
find /var/www/html/* -type f -exec chmod 644 {} \;
It seems that some software (Nginx maybe?) changes permissions so at least some directories (and maybe also their files) are becoming unwritable.
My question is why and how would any software change my permissions and what's the best way to deal with that?
I could add a daily crontask to bring back the aforementioned changes but some might not see that as a "neat" solution and it's best to change any suspicious software itself so it won't "dare" changing these permissions again.