2

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

user.dz
  • 48,105
  • Logout and login. The umask value is session specific. If you want the value instantly, just do umask 0077 – heemayl Nov 22 '16 at 13:52
  • Tried even a system reboot! – Chandra Sekar Nov 22 '16 at 13:53
  • 2
    Did you see http://askubuntu.com/a/276958/158442? – muru Nov 29 '16 at 01:30
  • Try this article here it should help resolve the issue. – George Udosen Nov 29 '16 at 12:22
  • @Chandru, It seems that the GUI/X session, override it somehow, so it does not follow the global setting in /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:13
  • @Chandru, I could find a note in https://wiki.debian.org/DebianDesktopHowTo#System Note 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

1 Answers1

-1

Edit the /etc/login.defs and change these values accordingly:

  1. UMASK 077 - as you earlier did
  2. Change this USERGROUPS_ENAB yes to USERGROUPS_ENAB no

Now log out then log back in. Create a new file and check the default permissions. Hope it helps.

George Udosen
  • 36,677