Dec
29
Posted on 29-12-2007
Filed Under (Linux commands) by Ravi Bhure

UMASK is a UNIX environment variable which automatically sets file permissions on newly created files.

The UMASK variable can be confusing to use, because it does work as a mask. In other words, you set the permissions that you do not want in the UMASK.

To calculate permissions which will result from specific UMASK values, subtract the UMASK from 666 for files and from 777 for directories.

If you want all files created with permissions of 666, set your UMASK to 000. Alternatively, if you want all files created with permissions of 000, set your UMASK to 666.

A reasonable value for UMASK is 022, which will cause files to be created with permissions of 644 (rw-r–r–) and directories to be created with permissions of 755 (rwxr-xr-x).

A more secure value for UMASK is 066, which will cause files to be created with permissions of 600 (rw——-) and directories to be created with permissions of 700 (rwx——).

UMASK is nomally defined in the .profile or .login user startup files.

Thank you,

Ravi Bhure

Similar Posts:

Be Sociable, Share!
(2) Comments    Read More   

Comments

ashish.dhawal on 16 February, 2008 at 5:31 pm #

why we use umask?
what is the umask for root 022
what is umask for non -pri 002


ashish.dhawal on 16 February, 2008 at 5:34 pm #

can we change users home directory using /etc/shadow? file?
can we assign a static ip to a machine using dhcp?
what are resources in dns?
what are different types of ip tables?


Post a Comment
Name:
Email:
Website:
Comments:


www.flickr.com
arunbagul's photos More of arunbagul's photos
Get Adobe Flash player
-->