Web lists-archives.com

Re: How to change default umask in Stretch?

On Mon, Aug 07, 2017 at 04:00:17PM +0000, Garrett R. wrote:
> I have created a file named ".xsessionrc" and it is in my home folder (~/.xsessionrc). Within this file I wrote this: umask 077.
> No change is evident. I first tried a relogin. No effect. I then rebooted. Also no effect. Creating documents still results in rw-r--r--.

Easiest way to verify it would be to open a terminal and run "umask".

> (I am logging in with gnome display manager and opening documents from the gnome-shell interface, not from a terminal).

In that case, it sounds like GNOME is overriding your umask.  You may
have to ask a GNOME support list how to work around this.  The first
Google result I found suggests adding it in ~/.gnomerc instead (in
addition to a crapload of obviously, blatantly *wrong* answers, as
usual).  I don't know whether .gnomerc will work, but you can try.

Rebooting would not matter.  The ~/.xsessionrc file is read by the
Debian X session when you login.  The problem is, anything you set there
can be changed later, e.g. by GNOME.

I tested it just now on my system, creating a ~/.xsessionrc file
containing "umask 002", and then running "startx -- :1" from tty2.
This gave me a(nother) X session, in which the umask was set to 002 as
expected (confirmed by running umask in a terminal).  But I don't
use GNOME.  I just use a window manager, fvwm.