Announcement

Collapse
No announcement yet.

Unable to set umask for all users

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Unable to set umask for all users

    I have a simple problem which I am unable to solve: I want to set the umask to 002 for all users on a Kubuntu 13.10 installation, but no matter what I try, it is always 022.

    I suppose the correct way to do this would be to set the UMASK in /etc/login.defs. In the default installation, it already contains
    Code:
    #...
    UMASK           022
    #... and ...
    USERGROUPS_ENAB yes
    According to the comments in login.defs, that already should result in a umask of 002. Since it did not work, I also tried setting UMASK 002, but did not work either.

    I also checked the /etc/pam.d configuration files and the lightdm file includes common-session, which in turn includes
    Code:
    session optional                        pam_umask.so
    I also tried to set the GECOS field via
    Code:
    sudo chfn -o "umask=002" username
    for one user, but did not work either. The umask is always 022.

    I also tried to turn debugging on for pam, adding "debug" to the pam_umask line in /etc/pam.d/common-session, but there is no output in the logs (I also enabled debug in rsyslog.conf) - maybe pam_umask is not used at all?

    Does anybody know why pam_umask does not work? And could anybody tell how to set the umask?

    (I want to set this for all programs started in KDE, so I assume .bash_XXX or .profile will not work...)

    #2
    It appears I've encountered the following bug:
    https://bugs.launchpad.net/ubuntu/+s...t/+bug/1240686

    A workaround is to disable upstart user sessions, commenting out kde-plasma from /etc/upstart-xsessions, although I don't know if there will be any side effects from disabling this....

    Comment


      #3
      As a work-around: Why not set umask at log in? I can think of several ways to do this without messing about with upstart or pam. For instance, add umask 0002 to .profile and /etc/skel/.profile.

      Please Read Me

      Comment


        #4
        Actually, I was not very happy with that solution either. But unfortunately, I already tried /etc/profile and that does not work, I don't think /etc/profile or ~/.profile is sourced anywhere during KDE startup anymore.

        Since I want to set it for the complete session, not just for shell sessions, any .bash_profile or similar will not work for me either, so.... any other ways you can think of?

        A slightly better solution I found is to put "umask 0002" into /usr/share/session/startkde (I have not access to the machine right now, so I'm not 100% sure the name and path are correct).

        Any better solutions would be very much appreciated...

        Comment


          #5
          Yeah, I wasn't thinking about outside bash. What about in rc.local or Xstartup? I'm not at my linux box at the moment, so I can't test it.

          I understand your desire. My previous distro used 0002 and a common user group as the default - which makes more sense to me. To me, the sensible set up is not having a special group for each user, instead default to the group "users" and then use a default mask of 0002. Then I can create a folder with simple group permissions as a public folder. For now, I'm using a special group called "share" and a public location with the GID sticky-bit set. Then at least everyone can access all the files equally.

          Please Read Me

          Comment

          Working...
          X