| Monash home | About Monash | Faculties | Campuses | Contact Monash |
| Staff directory | A-Z index | Site map |
|
An ITS guide to using Chmod on UNIXNOTE: You should read the ITS documentation on CHMOD before you read this documentation What is a UMASK?The 'UMASK' is the default permission setting that is applied to your files and directories when they are created. After files and directories are created, the chmod command can be used to change the permissions to allow or disallow access as before. The UMASK is set when you login to a UNIX machine. It is, however, possible to change your UMASK and put the UMASK in your login files so that your default permissions are always set for files when you create them. Just like chmod, a umask works on a number. However, instead of the numbers being ADDED like chmod, with a umask the numbers are SUBTRACTED from 7. So from chmod - Read - 4 If a user wants all directories to be created with rwxr-xr-x, that is Owner == Read, Write, Execute == 7 - 4 - 2 - 1 == 0 Then the umask would be 022 There is one important difference with the UMASK and files and directories - the execute part will be set on directories, but they have to be manually changed on files after the file has been created. The read and write parts remain the same. You can change your default UMASK using the command 'umask'. For example, the command: umask 022 Will change your umask to the permissions stated above. To make your new umask be the default for your next login, you will have to edit your .login file and place the umask command down the bottom of that file. The next time you login to your UNIX system, your default umask will be set to that which you have specified in your .login file. |