5.5 Default Permissions

When you create a file or directory, predefined permission are set on that file or directory. The current default permissions are:

Files:                 rw-rw-rw-

Directories:    rwxrwxrwx

To change the default permissions, you must change the umask setting. The umask tells the system what permission not to set.

The following text and chart can be used to determine a umask entry:

  1. Know the MAXimum possible permissions for files and directories
  2. Determine what you want your permissions to be when you either create a new file or directory. You will need to pick one (either file or directory) and understand that the umask command affects both.
  3. Figure out what permissions of the MAXimum permissions need to be taken out (MASKed out).
  4. Compute the values (in octal notation) of what needs to be MASKed out for the owner, group and other. The resulting three numbers is what you will use to set your umask.
Step   File Directory
1 MAX rw- rw- rw- rwx rwx rwx
3 MASK (m=mask) --- -m- mmm --- -m- mmm
4 umask=027 0 2 7 0 2 7
2 desire rw- r-- --- rwx r-x ---

Click here to go back