Make it optional to use pam_slurm_adopt #1111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
We currently configure DeepOps Slurm clusters to use
pam_slurm_adopt.soin the SSH authentication process. This module does two things:This behavior is exactly what you want on a production system, in order to prevent one user from interfering with another's workload. However, it often causes confusion for users new to Slurm, and doesn't always correspond to what you want on a development system which may be undergoing frequent change.
This PR adds two new role variables to the Slurm role:
slurm_restrict_node_access: When enabled, denies SSH to users without a job on the nodeslurm_enable_pam_slurm_adopt: When enabled, sets up pam_slurm_adopt to adopt SSH processes into the jobBy default, both of these are
true. Ifslurm_restrict_node_accessis set to false, SSH processes will still be adopted into the job for accounting and cleanup purposes, but otherwise allow access without a job on the node. Ifslurm_enable_pam_slurm_adoptis set to false, thenpam_slurm_adopt.sowill not be used at all.Test plan
slurm_restrict_node_access: falseand create a new user who is not included inslurm_allow_ssh_user. Confirm that the user can SSH from the login node to the compute node.slurm_enable_pam_slurm_adopt: false. Run a job, SSH in from another terminal, and confirm the SSH process isn't adopted.