User Tools

Site Tools


howto:umask

umask

The CHPC cluster uses CentOS as its operating system and follows the user private group convention for user accounts. This means that each user has a username (UID) and a corresponding group (GID). This scheme allows for easier set up of shared directories on the various file systems (home or Lustre) that users have access to.

Default umask

The default umask is set by the umask command in your .bashrc or the system wide /etc/bashrc file. For RedHat derived systems (CentOS) the default umask is 002 which means the the group permissions of your files and directories will match the user permissions and include write access, the w flag.

This is needed for shared groups (not your private user group) where all members of the group need write access.

Checking your current umask

Simply run the command umask without any arguments on the shell:

umask

and your current umask setting will be displayed:

002

To change it, run the umask command with the desired umask as the sole argument:

umask 022

And you can confirm this by running umask on its own again.

CHPC Standard

The CHPC departs from the user private convention in one important way. The convention would normally only specify that the user is a member of the user's private group. The CHPC adds the user name of the CHPC staff member responsible for supporting your programme.

So, instead of

auser:*:555:

where there is no user in the group, we have

auser:*:555:chpcstaff

where chpcstaff would be the username of the CHPC staff member.

This is to allow our staff to have access to your files to help you with technical issues.

Disabling write access

If you want to remove the w access from the group permission you will need to change your umask and also change all the current permission bits.

Step 1: umask

Edit your .bashrc file in you home directory and add the line

umask 0022

at the end of the file. Save it. Now when you log in next time your umask will block w from group access.

Step 2: remove w access from all files and directories

Warning: this can take a long time if you have a lot of files so first launch an interactive session before running these commands.

qsub -I

Use the find command:

find . -exec chmod g-w \{\} \;

References

/var/www/wiki/data/pages/howto/umask.txt · Last modified: 2019/03/07 17:47 by wikiadmin