Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown    



UMASK
( Advanced permissions )


Before you read this Tip be sure to check out File Permissions and Changing File Permissions

Umask is the number subtracted from the standard permissions when creating a file. Example: each new file is by default created with 666, so when umask is set to 022, the result is that the permissions will be 666 - 022 = 644 ( meaning read-write for the owner and only read for the group and all others.

Most of the time umask will already be set by your distro to 022 but you can change it if you like. You can see what umask value is set with:

CODE
$ umask

You can set umask to another value like this:

CODE
$ umask 066

That value will then stay until you log out and then return to its default value. If you want the alternative value to be permanent put "umask 066" in your ~/.bash_profile or/and for root in /root/.bash_profile.

If you like your install to be more secure you might set the umask value of root to umask=066 in /root/.bash_profile so every file root makes has disabled read and write permissions for others than root.



Bruno



More info: http://www.linuxsecurity.com/content/view/117255/



-- Feb 27 2006 --



Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown