cancel
Showing results for 
Search instead for 
Did you mean: 
Ksahil
Flight Engineer
Flight Engineer
  • 1,889 Views

Umask question?

Jump to solution

Configure umask 033 for all user, users root and Student1 must have their own 022 umaks.

how do you write this answer?

1 Solution

Accepted Solutions
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,848 Views

@Ksahil  That's what I mentioned in my answer. For default user setting : it is /etc/profile. 

After that if you need to have a different umask setting for some user , you can edit their respective shell profile files ( .bashrc or bash_profile).

For some 50 users scenario , you would need to have a shell script and use a loop which can change the umask for those 50 users : use for loop to do this : echo "umask umask_value" >> home_dir/.bashrc" for all users in the list. 

Refer : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_syst... 

View solution in original post

4 Replies
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,859 Views

Hello @Ksahil !

Thanks for reaching out!

System wide default umask is set in /etc/profile  directory. That will be effective for all users including root user. ( We also use /etc/login.defs file for setting a default umask value for all new users , however the umask value specified in /etc/profile applies to all users' shell sessions, including existing users.)

If you want to change that for a particular user : edit the respective shell profiles ~/.bashrc or ~/.bash_profile file in their home directory path.

You just have to add the line : "umask 033" in those files.

Ksahil
Flight Engineer
Flight Engineer
  • 1,850 Views

Hello @Chetan_Tiwary_, Thank you for giving your valuable time to answer it.

I understand your points but how can I answer the question ... solution?

Because "root and Student1 must have their own 022 umaks" and the rest users have "033" permission.

Suppose this I have to do on bulk users in the ratio of 50:50 how can we perform the steps?

(For 50 users we have to keep 022 and other 50 we have to do 033.)

Thank you !!

 
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,849 Views

@Ksahil  That's what I mentioned in my answer. For default user setting : it is /etc/profile. 

After that if you need to have a different umask setting for some user , you can edit their respective shell profile files ( .bashrc or bash_profile).

For some 50 users scenario , you would need to have a shell script and use a loop which can change the umask for those 50 users : use for loop to do this : echo "umask umask_value" >> home_dir/.bashrc" for all users in the list. 

Refer : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_syst... 

Ksahil
Flight Engineer
Flight Engineer
  • 1,797 Views

Hello @Chetan_Tiwary_ , Thank you for giving valuable and answering my question.

 

Regards, Saahil

Join the discussion
You must log in to join this conversation.