I cannot get the default umask for a session to be 0077
.
I have edited /etc/login.defs
and set the value to 077
there:
UMASK 077
Also I've made sure the following entry exists in /etc/pam.d/common-session
:
session optional pam_umask.so
While this configuration seems to work when the user logs in using su
it doesn't when the login happens through mdm. Both mdm and su configuration files in pam.d include common-session.
username@hostname ~ $ umask
0022
username@hostname ~ $ su username
Password:
username@hostname ~ $ umask
0077
This problem does not occur when using GDM or LIGHTDM instead of MDM.
Any ideas on what could be a possible cause of this?
Best Answer
This doesn't directly answer your question but this technique might help you shed some light on if there's a stray
umask
command being run somewhere as part of your shell's config files:-x
-> enable debugging-l
-> login shell-i
-> interactive shell-c
-> commandThe
exit
is necessary so that the shell returns once it's done.example
I found the above technique over in this U&L Q&A titled: How to test for possible conflicts while using alias in bashrc?.