To enable SSH agent forwarding when connecting to Slurm computation nodes, you need to ensure two things:
ssh-agent
On your local machine (not the Slurm nodes), make sure your SSH agent is running and your keys are loaded:
eval $(ssh-agent -s) ssh-add ~/.ssh/id_ed25519 # Replace with your key path if different
~/.ssh/config
On your local machine, edit or create ~/.ssh/config and add:
Host dalia.idris.fr ForwardAgent yes
If you connect to the Slurm master node via a bastion/jump host, you need to ensure the forwarding is set up for the entire chain:
Host dalia.idris.fr ForwardAgent yes Host *.idris.fr ForwardAgent yes
When you SSH into the Slurm master node, use:
ssh -A dalia.idris.fr
When submitting a job or connecting to a computation node via srun or sbatch, ensure you use the -A flag:
srun
sbatch
-A
srun -A --jobid=<jobid> ssh <computation-node-ip>
Or, if you use sbatch:
#SBATCH --get-user-env=1
This ensures the agent is forwarded to the computation node.
Summary:
ssh-add -L
This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.
Vibe can make mistakes. Check answers. Learn more