Directory Permissions and File Sharing

If you are unfamiliar with Linux file permissions you should consider reading sections 5.1 and 5.2 of this Intro to Linux course (from the University of Surrey) first.

Home Directory Permissions

The default permissions on your home directory on the CSF allow access to you (the user) only. The directory is private to you.

Every user on the CSF also belongs to a unix group on the system. This usually represents your research group, but could represent your school or faculty if your access to the CSF is the result of a school or faculty contribution. For example, users in the Department of MACE are members of the mace01 unix group on the CSF.

It is possible to allow other users in your unix group to access your home directory (e.g., to share files), but this is not the default.

You can run the commands in bold at the login node prompt below. For example:

[username@login1[csf3] ~]$ ls -ld $HOME
drwx------ 37 username zz01 4096 Aug 15 09:59 /mnt/iusers01/zz01/username
||_||_||_|              |
| |  |  |               +--- Your unix group (based on the CSF contribution you are assigned to)
| |  |  |
| |  |  +-- (---) indicates others (all users) CANNOT access your HOME dir
| |  +----- (---) indicates people in your group (zz01) CANNOT access your HOME dir
| +-------- (rwx) indicates user (you) CAN read, write and execute (enter) your home directory.
|
+----- directory (will be a dash - if looking at a file's properties)

If you want colleagues in your group to be able to read and copy some of your files, you can set group permissions with the chmod command as follows:

[username@login2[csf3] ~]$ chmod g+rx $HOME
                                  #
                                  # This adds group read and execute
                                  # permissions to your home directory.   

Let’s check how it looks now:

[username@login2[csf3] ~]$ ls -ld $HOME
drwxr-x--- 37 username zz01 4096 Aug 15 09:59 /mnt/iusers01/zz01/username
    |_|
     |
     +---- Now members of your group (zz01) CAN read and execute (enter) your
           HOME dir but notice they CANNOT write to it.

The default file permissions within home directories should be sufficient to now allow people from your group to read the contents of the files and to copy them to their own home directory. If opening the permissions to all members your group is too wide-open, then please let us know who you would like to have access, and we will advise further.

It is highly recommended that you never give anyone else write (w) permission to your directory or files as this allows them to modify or delete them.Please note that directory permissions override file permissions.

Also be aware that groups can be very large and contain a lot of people with whom you do not directly work.

If you want your colleagues to be able to edit / write new / delete files in your area please fill in our help form to request advice.

Scratch Directory Permissions

Default permissions on your scratch directory are the same as on your home directory – your scratch directory is private to you. As with the home directory, it is possible to change the permissions on your scratch directory to allow your colleagues to access your files.

NOTE: When working with scratch permissions you must use the direct path to your scratch directory:

/scratch/username
           #
           # Use your own username here

NOT the symnlink/shortcut you have in your home directory. Thus the command to check your scratch permissions would be:

ls -ld /scratch/username

If you need to change your scratch permissions then the procedure is the same as for home – see above.

Remember: the scratch filesystem IS NOT backed up. It is highly recommended that you never give anyone else write (w) permission to your directory or files as this allows them to modify or delete them.Please note that directory permissions override file permissions.

Also be aware that groups can be very large and contain a lot of people with whom you do not directly work.

If you want your colleagues to be able to edit / write new / delete files in your area please fill in our help form to request advice.

Group Research Data Storage

Some groups have an allocation of Research Data Storage (RDS) on the CSF. This is additional storage that can provide a lot more capacity than your group’s home area – usually several TB’s worth of storage. RDS storage is backed-up, just like your home directory, and is suitable for long-term storage of important files (e.g., data-sets, results).

For example:

/mnt/fac01-rds/smith-project/
      #                #
      #                # The directory name usually indicates the PI and project name
      #
      # fac is usually a short form of your faculty 

which usually contains a directory for each person authorised to use the space and sometimes shared directories.

Permissions for RDS owners – keeping your RDS secure

If you are anything other than a read-only member of an RDS share on iCSF or CSF3, you need to understand how to control access to directories and files.

It is critical that you do not accidentally give access to large numbers of CSF users when changing permissions, if you are unsure how to adjust permissions, ask for support, DO NOT rely on AI chatbot suggestions.

Linux permissions explained for RDS

Every file and directory has permissions for three types of users:

User (the owner)
Often the person who created the directory or file, but on RDS you may be given ownership by the admins to allow you to manage the directory.

Group
A defined group of users. On RDS these are the groups users are added to when access is granted.

Other
Everyone else.

You must be very careful with ‘other’ permissions if you are the owner of a top-level directory, as setting ‘other’ permissions can give access to all users of the CSF.

For each of the 3 types of users above, three permissions can be given:

  • r = read = view the contents.
  • w = write = change the contents.
  • x = execute = run a file as a program or, in the case of a directory, navigate into it.

In general, a top-level RDS directory will have permissions:

drwxr-x--- 37 username groupname 4096 Feb 29 01:54 /mnt/fac01-rds/project

Owner has full access; group members have read and execute (means they can navigate into the directory)

Or:

drwxrwx--- 37 username groupname 4096 Feb 29 01:54 /mnt/fac01-rds/project

Owner and group members have full access (but only the owner can control permissions of the directory)

A top-level directory will generally not look like:

drwxrwxr-x 37 username groupname 4096 Feb 29 01:54 /mnt/fac01-rds/project

as the last r-x means that all users of CSF can read the contents.

Modifying permissions

You must be the owner of a file or directory to change permissions.

You can change permissions using the chmod command.

To give the group members read access to a file:
assign group read:

chmod  g+r  filename

check permissions:

ls -l filename

for a directory:

chmod g+rx directoryname

for a directory and all files and subdirectories within:

chmod -R g+rx directoryname

The -R option (recursive) can take some time to complete for large numbers of directories and files.

check with:

ls -ld directoryname

To remove group access from a file:

chmod  g-r  filename

for a directory:

chmod g-rx directoryname

If you need any more complex permissions or are unsure ask for support.

Last modified on October 30, 2026 at 12:04 pm by Martin Wolstencroft