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