umask

Changing the default umask

In many distros, the default umask value can simply by set by adding the following line to /etc/profile

umask 002

(The above example would set it to 002, change the value as needed)

PAM umask module

On e.g. Debian Stretch, this does not seem to work. One way to I found to work is pam. Add the following line to /etc/pam.d/common-session

session optional   pam_umask.so

Then set the desired umask value in /etc/login.defs:

UMASK     002

You may still have to additionally set it in your .bashrc