Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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:

$ bash -x -l -i -c 'exit' 2>&1 | grep 'umask'
  • -x -> enable debugging
  • -l -> login shell
  • -i -> interactive shell
  • -c -> command

The exit is necessary so that the shell returns once it's done.

example

$ bash -x -l -i -c 'exit' 2>&1 | grep umask
+ umask 002
$

I found the above technique over in this U&L Q&A titled: How to test for possible conflicts while using alias in bashrc?.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                  <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2015 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2015.4.28.2539\r\n            </div>\r\n                <div id=\"additional-notices\">\r\n                    Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group. <br>This site is not affiliated with Linus Torvalds or The Open Group in an"], "copyright__copyright__copyright": ["hell\n  \u2022 -c -> command\n\nThe exit is necessary so that the shell returns once it's done.\n\nexample\n\n$ bash -x -l -i -c 'exit' 2>&1 | grep umask\n+ umask 002\n$\n\nI found the above technique over in this U&L Q&A titled: How to test for possible conflicts while using alias in bashrc?.\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}