How to create user groups
You can create users for everyone who works with your cluster and add multiple groups that give their members different access permissions. Each user may be a member of several groups.You need administrator privileges to create users and groups.
Add a group
Add a user to a group
How to manage default permissions for created files
When you create a new file or directory, its permissions are determined by theumask value and the default group settings on the directory where the file is created.
umask
Theumask specifies which bits are removed from the full permissions (666 for files and 777 for directories). All possible permissions are listed in full in the Ubuntu documentation.
Check your umask value:
0002, which means that the permissions are the following:
- For new files:
0666-0002 → 0664— everyone can read, the owner and file group members can write. - For new directories
0777-0002 → 0775— everyone can read and execute, the owner and file group members can write.
umask, for example:
644 permission, and new directories with 775.
To make the umask setting permanent for the current user, add it to the shell configuration:
Default groups
By default, a new file belongs to the primary group of the user who created it. For a shared directory owned by a group, you may want all new files created in the directory to inherit the same group. To do that, set thesetgid bit in its permissions: 2 instead of 0 in the high-order octal digit of the group permissions.
To set the group ownership and inherit file permissions, run the following commands:
How to set granular permissions with ACLs
Access Control Lists (ACLs) let you override the default permissions and explicitly specify which users or groups have different levels of access to specific files or directories. Use thesetfacl command to set the ACL for a file or directory. For example, to give a user read and write permissions to a file, run the following command:
Set default access to a directory
To set default permissions, add the-d option to the setfacl command. This modifies the default ACL, and all new files created in this directory inherit these permissions.
For example, to give all group members read, write and execute permissions to a directory and all new files created in it, run the following command:
View current ACLs
To check the current ACLs for a file or directory, run the following command:Main scenarios
Depending on your workflow, you can create read-only datasets or read-write working directories and configure access for individual groups or all users.Read-only dataset shared with all users
Create a shared dataset that contains source data for training or evaluation. Make it read-only to prevent accidental changes or data corruption and ensure consistency across all training runs.-
Create a directory in a shared filesystem, for example:
-
Set permissions so that all users can read files, but only administrators can modify them:
-
Make sure your users can access it:
- Single jobs can access the shared filesystem and the directory in it.
- If needed, the users can mount the shared directory as a volume to their jobs or containers, in read-only mode.
sudo.
Read-write directory for training results
Use a separate directory to save checkpoints, model outputs and logs. Make it writable by the job owners or a specific team.-
Create a directory for results:
-
Create user groups (for example,
mlteam) and add users to them. For the group membership to take effect, ask the users to log out and reconnect to your cluster. -
Grant write permissions to the required group, for example:
The
2in2775sets thesetgidbit to ensure that all new files in the directory inherit the group.
Collaboration between two groups
When two groups work on related tasks, configure three shared directories: private to group A, private to group B and accessible to everyone.-
Create user groups. For example,
groupAandgroupBfor each of the teams, andusersfor everyone. - Add users to the groups. For the group membership to take effect, ask the users to log out and reconnect to your cluster.
-
Create the directories:
-
Set the
groupAandgroupBdirectory permissions to full access for the corresponding group and no access for anyone else:The2in2770sets thesetgidbit to ensure that all new files in the directory inherit the group. -
Set the
commondirectory permissions to let everyone in theusersgroup have full access: