I want to make 002 the system-wide umask for all users (in Ubuntu). I managed to do so for all regular users using the instructions provided by @ephemient (From this post, thanks for that!). However I got 2 more problems.
Firstly, when sudoing, the root user seems to follow it's own settings, making files with the permissions 644 (instead of 664).
Secondly, the apache user (www-data) also seems to follow it's own settings (the same used by root?), making files with the permissions 644 (instead of 664). I don't like to put umask 002
in /etc/apache2/envvars
, I'd rather change the setting assigning the 002 umask to apache in the first place.
How can I tackle those last 2 issues?