Web lists-archives.com

Re: How to change default umask in Stretch?




On Mon, Aug 07, 2017 at 03:25:27PM +0000, Garrett R. wrote:
> I have set /etc/login.defs to a umask of 077. Also, I commented out the USERGROUPS_ENAB entry.
> 
> When I create gedit documents (for example), I am getting rw-r--r--. This does not reflect umask 077.
> 
> I then went to ~/.profile and set umask there. But this had no effect on anything.

OK, you're not going to give us any details without tooth-pulling.
That sucks.  I will have to rely upon guesswork.

You used the word "login" and the word "gedit".  This tells me that you
may be concentrating, currently, one of the two following scenarios:

1) You login locally through a display manager into an X session.

2) You login locally on the Linux console and use startx to launch
   an X session.

Now, we can probably rule out #2, because you claim that modifications
to ~/.profile did not work.  There are various situations where you
*could* still be using console login + startx and have your changes in
~/.profile not take effect, but the simplest answer suggests you are
not doing that.

So, you're probably logging in through a display manager.

If you want to configure the X session that you get when logging in
through a Debian display manager, use the file ~/.xsessionrc
instead of ~/.profile.

See <https://wiki.debian.org/Xsession>.

Yes, Virginia, ~/.xsessionrc does not exist by default.  You would have
to create it.  (These days, users have to be *told* this for some reason.
They whine and moan if you don't reassure them that yes, it's OK that
a file doesn't exist and that they should create it.  Sad but true.
And this user top-posted, so I'm inclined to suspect he/she falls into
that group.)

No, I am not talking about ~/.xsession.  ~/.xsessionrc is a totally
different file.