Where is my umask being set to 0002?

Keith keith at caramail.com
Wed Apr 13 14:03:01 UTC 2022


On 4/13/22 7:06 AM, Chris Green wrote:
> On Wed, Apr 13, 2022 at 05:02:06AM -0700, Smoot Carl-Mitchell via ubuntu-users wrote:
>> On Wed, 2022-04-13 at 11:41 +0200, Ralf Mardorf via ubuntu-users wrote:
>>> Maybe in /etc/login.defs ?
>>
>> You can set it in your .profile or your.bashrc startup file for the
>> bash shell or in /etc/profile globally.
>
> OP here, yes I know how to set the umask, what I was asking was where
> is the default value set?
>

As it mentions in /etc/login.defs, if the USERGROUPS_ENAB setting is set
to "yes" as in the case of user home directories where the primary
groupname is the same as the username, the pam module, pam_umask will
set the default umask value to 0002.

If you wish to set the umask back to 0022 (or whatever you prefer) on a
system-wide level and keep USERGROUPS_ENAB set to "yes", you can edit
file /etc/pam.d/common-session to uncomment the line

#session optional    pam_umask.so

and change it to

session optional    pam_umask.so umask=0022

If you want non-interactive services to use the same mask as you set in
common-session, then you'll need to modify the same setting in
/etc/pam.d/common-session-noninteractive also.

--
Keith




More information about the ubuntu-users mailing list