You are not logged in.
Hi everyone,
On my loved Devuan (chimaera) my umask is set a 027
Trough
session optional pam_umask.so umask=027
So every new files is 640 (As attended)
What is weird when I do a useradd -m -c "John doe" John
I've got 755 on /home/John
Why useradd doesn't apply the umask ?
When the user login all the newly created sub folders such as /home/john/Desktop are 640
any ideas ?
Last edited by SpongeBOB (2022-04-17 05:41:36)
Linux noob, plz be kind
Offline
Edit /etc/login.defs instead, UMASK is set there. See login.defs(5) & useradd(8) for more on this.
Note that the umask setting in /etc/pam.d/ can be over-ridden by (for example) /etc/profile & ~/.profile.
Brianna Ghey — Rest In Power
Offline
Thanks HOAS !
So what is the "order of authority" with UMASK ?
/etc/login.defs
~/.profile
/etc/profile
/etc/pam.d/
Linux noob, plz be kind
Offline
Indeed /home/john directory is 750 when changing the UMASK in /etc/login.defs
but some of the 4 defaults files (before user login) are not as intended (in bold)
644 .bash_logout
644 .bashrc
750 .config (dir)
644 .profile
640 .config/autostart/oneshot.desktop
Any ideas ?
Linux noob, plz be kind
Offline
The files with different permissions are copied from /etc/skel/:
-k, --skel SKEL_DIR
The skeleton directory, which contains files and directories to be copied in the user's home
directory, when the home directory is created by useradd.This option is only valid if the -m (or --create-home) option is specified.
If this option is not set, the skeleton directory is defined by the SKEL variable in
/etc/default/useradd or, by default, /etc/skel.If possible, the ACLs and extended attributes are copied.
(Added emphasis.)
SSo what is the "order of authority" with UMASK ?
The file that applies umask last will "win" so that would be ~/.profile but note that file is not read if LightDM is used to log in.
Brianna Ghey — Rest In Power
Offline
Hoo I didn't know for the ACLs and extended attributes are copied.
I just modified the attributes of the files within the SKEL and indeed it works !
Thanks HOAS
Linux noob, plz be kind
Offline