Last Updated: Dec 25, 2025
Introduction
There may come a time where you'll need to add an additional user to your SLURM cluster. Here's a step-by-step article on how to add a user to your SLURM cluster.
Step-by-Step Instructions
Method 1 - Terraform: Update the SLURM main.tf file
To add additional users to your cluster, configure the slurm_users variable in your terraform.tfvars file and run terraform apply.
The following example adds three additional users user1, user2, and user3 to the SLURM cluster.
# slurm users configuration
slurm_users = [{
name = "user1"
uid = 1001
ssh_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjPRr0iVR4mgzJy0ehnM5hWX4O86hM1bVTgdi5g3nkZ user1@crusoe.ai"
}, {
name = "user2"
uid = 1002
ssh_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjPRr0iVR4mgzJy0ehnM5hWX4O86hM1bVTgdi5g3nkZ user2@crusoe.ai"
}, {
name = "user3"
uid = 1003
ssh_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjPRr0iVR4mgzJy0ehnM5hWX4O86hM1bVTgdi5g3nkZ user3@crusoe.ai"
}]
2. Method 2 - Manual: Run useradd on the login and head node
- Run the following commands on both the login and head node
sudo useradd -u $NEW_USER_UID $NEW_USER -s /bin/bash -m
sudo usermod -aG <group_name> <user_name>
sudo passwd -d $NEW_USER- Then add the SSH key for the new user to the ~/.ssh/authorized_keys file on each of those nodes to enable SSH access to the cluster.