Why a umask of 0027 creates files like 0640

The User Mask (umask) can be managed with the command umask. A umask is the reverse value of the octal permission set that files and directories are created with.

So, a umask of 0777 creates files with an octal permission value of 0000; no permissions to read, write or execute.

But; there is a strange thing about the umask; it never allows to make files executable. Here is a demonstration of this "flaw"/"security feature".

$ umask 0027
$ touch me
$ ls -l me | awk '{print $1}'
-rw-r-----

I would have expected 750, instead 640 is produced. This is default security behaviour of UNIX/Linux.

About Consultancy Articles Contact




References Red Hat Certified Architect By Robert de Bock Robert de Bock
Curriculum Vitae By Fred Clausen +31 6 14 39 58 72
By Nelson Manning [email protected]