I know there's a ton of questions about this topic but I'm not being able to find the right answer. I have GNOME Version 3.22.2 running on a Debian GNU/Linux 9 (stretch) 64-bit.
I'm trying to set up a shared folder (say
thefolder) such that multiple users of a group (say
thegroup) on the same machine can work on it. To do that I changed the ownership of the folder to
thegroup and set the setgid bit of the folder.
$ ls -l drwxrwsr-x 6 me thegroup 4096 Oct 1 20:29 thefolder
The only problem now is that the default umask in Debian is 0022 and this prevents other users to write on any subfolders or files that I create on
What I've done so far:
My first (naive) try was to set the umask in one of the shell configuration files. I added the line
in all of the files
~/.bashrc(each one at a time obviously) until I realized that this worked only for the shell (GNOME Terminal and TTYs) but not for other applications like Files or Gedit. I then deleted all these lines and tried something else.
I added the line
session optional pam_umask.so usergroups
at the end of the file
/etc/pam.d/common-sessionand restarted the computer. It is worth noting at this point that the options
USERGROUPS_ENAB yesare both enabled in the
/etc/login.defsfile. Having done that I noticed that the umask was correctly set as 0002 for TTYs but not for the GNOME session (the GNOME Terminal and all other programs accessed through the graphical interface still worked with a 0022 umask)
After that I tried to set the umask in the Xsession script of the GNOME Display Manager. I wrote the line
at the begining of the file
/etc/gdm3/Xsessionbut the problem persisted. I made a little experiment and wrote instead the following line
echo "umask: $(umask)" > $HOME/Desktop/debug
and after log out and log in again the
debugfile contained the line
which means that at that point the umask was still correct and that it is overwritten somewhere else after the Xsession script.
Can someone explain to me where is the umask for the GNOME session defined and how can I change it?