Topics Summary

What are the original file and directory permissions?

The original directory permissions are 777 or ‘rwxrwxrwx’

The original file permissions are 666 or ‘rw-rw-rw-‘

 

Which differentiates the original and default file or directory permissions?

Or

What is umask value?

The umask value differentiates, the original and default file or directory permissions.

File directory

666 777 ----------- original permissions

-644 -755 -----------Default permissions

022 022 -----------Umask value

We can see that, whenever we subtract  the default permissions from original permissions, we get the umask value.

From this analysis, we can conclude that the umask value will decide the default file and directory permissions.

 

To change the umask value the command is #umask

[root@sys2 /]# umask 002

[root@sys2 /]# umask

0002

 

But this change of umask value is not permanent whenever the system reboots we loss this change.

 

To change the umask value permanently edit the /etc/bashrc file 

# vi /etc/bashrc

66 umask 002

67 else

68 umask 022

 

Edit the 68th line to change the umask value permanently.