I now want to change my user's umask from 022 to 027, so new files and directories will also be secure. I have tried adding to ~/.profile the
line
umask 027
and rebooting but it did not work. I tested by, in Emacs (launched from Gnome), creating a new file in my Home and it did not respect the 027
umask.
So, how do I change my user's umask for the entire Gnome session?
Do you have a separate filesystem for /home? If so, the simplest option
is to set umask in its mount options in fstab. This will affect all
users, except root, and it won't affect files you write outside of $HOME.
Do you have a separate filesystem for /home? If so, the simplest
option is to set umask in its mount options in fstab. This will
affect all users, except root, and it won't affect files you write
outside of $HOME.
That is not documented in the mount manpage as a filesystem-independet option; it only shows for specific filesystems, none of which I use.
Anyway, I use Btrfs and I have a separate subvolume for /home. I have
tried adding umask=077 (later umask=0077) as fstab option and invoking #
# mount -o remount /home
but in both cases it errored out:
mount: /home: mount point not mounted or bad option.
dmesg(1) may have more information after failed mount system
call.
dmesg says:
BTRFS error (device nvme0n1p7: state M): unrecognized mount option 'umask=077'
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 302 |
Nodes: | 16 (0 / 16) |
Uptime: | 96:51:54 |
Calls: | 6,764 |
Calls today: | 2 |
Files: | 12,295 |
Messages: | 5,376,370 |
Posted today: | 1 |