The officially official Devuan Forum!

You are not logged in.

#1 2022-04-16 06:38:09

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 102  

[SOLVED] /home/newuser do not match the umask

Hi everyone,

On my loved Devuan (chimaera) my umask is set a 027

Trough

/etc/pam.d/common-session wrote:

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 big_smile

Offline

#2 2022-04-16 08:42:53

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] /home/newuser do not match the umask

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

#3 2022-04-17 05:27:51

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 102  

Re: [SOLVED] /home/newuser do not match the umask

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 big_smile

Offline

#4 2022-04-17 06:12:14

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 102  

Re: [SOLVED] /home/newuser do not match the umask

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 big_smile

Offline

#5 2022-04-17 10:09:25

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] /home/newuser do not match the umask

The files with different permissions are copied from /etc/skel/:

useradd(8) wrote:

       -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.)

SpongeBOB wrote:

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

#6 2022-04-18 06:36:01

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 102  

Re: [SOLVED] /home/newuser do not match the umask

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 big_smile

Offline

Board footer