Linux umask for sudo and apache

I want to make 002 a system-wide umask for all users (on Ubuntu). I managed to do this for all regular users using the instructions provided by @ephemient ( From this post , thanks for that!). However, I have two more problems.

First, with sudoing, the root user seems to perform his own settings, creating files with 644 permissions (instead of 664).

Secondly, the apache user (www-data) also seems to perform its own settings (the same as using root?), Creating files with 644 permissions (instead of 664). I do not like to embed umask 002in /etc/apache2/envvars, I would prefer to change the setting that assigns 002 umask to apache in the first place.

How can I solve these last 2 problems?

+4
source share
1 answer

I solved my problems.

For sudo permissions, I executed sudo visudoand added a line Defaults umask = 0002to the end.

For the Apache user, I added a line umask 0002at the end /etc/apache2/envvars(I did not find a better solution).

+7
source

Source: https://habr.com/ru/post/1534660/


All Articles