To change the default permissions assigned to your UNIX files and directories, use the umask command. umask is a little confusing at first. Its format is
umask nnn
where nnn is a three-digit code that defines the new default permissions. The umask string does not have the same format as the the chmod permission string.
Each of the three numbers represents one of the categories user, group, and other. The value for a category is calculated as follows:
read permission has a value of 4
write permission has a value of 2
execute permission has a value of 1
Sum the permissions you want to set
for the category, then subtract that
value from 7.
As an example, examine the current default umask statement that is used to assign the file protections -rwx-r-x--- :
umask 027
The user category value is 0 because r+w+x = 4+2+1 = 7. When this is subtracted from 7, the value is 0.
The group category value is 2 because r+x = 4+1 = 5. When this is subtracted from 7, the value is 2.
The other category value is 7 because no permissions = 0. When this is subtracted from 7, the value is 7.