I have set UMASK 077 in /etc/login.defs and there is no override in ~/.profile or ~/.bashrc.
The umask command still prints 0022 in gnome-terminal, but prints 0007 when I log into tty1. Newly created files get the same permissions as when umask is set to 0022.
Ubuntu version: 16.10
umaskvalue is session specific. If you want the value instantly, just doumask 0077– heemayl Nov 22 '16 at 13:52/etc/login.defs(it could be hard-coded, because there are some similar questions in unix and so, w/out accepted answer too) – user.dz Dec 05 '16 at 10:13Note that the GNOME display manager (gdm) overrides the system's default umask. Thus, if you use gdm you may try to fix it, or just install another dm like kdm, slim, or LightDM.but I think most DM's do same as GDM. – user.dz Dec 05 '16 at 14:59