Wednesday, 19 February 2020

How to Set Umask for a System User on CentOS 8




When user created a file or directory CentOS 8 and other distribution, the file or directory created with a default set of permissions. By default the file permission has 644 a directory created with 755 permissions, grants read, write, and execute permission to the owner and read and execute permission to groups and others.

This article describes How to Set Umask for a System User on CentOS8.

By default it is set 077 as below:

[root@linuxcnf ~]# grep -i umask /etc/login.defs
UMASK           077
[root@linuxcnf ~]#

Change the user default umask by editing UMASK value in file /etc/login.defs file as below:

[root@linuxcnf ~]# vi /etc/login.defs
……………………………
UMASK           027
……………………………
[root@linuxcnf ~]#

Done!!! Now Umask value will be 027.

No comments:

Post a comment