Skip to content

Commit 0511977

Browse files
feat(slurmd): add SSH support with pam_slurm_adopt to 25.05
1 parent 0ea348b commit 0511977

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

schedmd/slurm/25.05/rockylinux9/files/usr/local/bin/slurmd-entrypoint.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@ function addConfItem() {
9595
export SLURMD_OPTIONS="${slurmdOptions[*]}"
9696
}
9797

98-
# Configure PAM for pam_slurm_adopt (following login's dynamic pattern)
98+
# configure_pam configures PAM to use pam_slurm_adopt for SSH sessions.
99+
#
100+
# This allows SSH access to be restricted to users with active jobs on the node.
99101
function configure_pam() {
100102
# Add pam_slurm_adopt to SSH PAM configuration if not already present
101103
if ! grep -q "pam_slurm_adopt.so" /etc/pam.d/sshd 2>/dev/null; then
102-
# Insert after common-account include
104+
# Insert after account include password-auth (Rocky Linux specific pattern)
103105
sed -i '/^account[[:space:]]*include[[:space:]]*password-auth/a -account required pam_slurm_adopt.so action_no_jobs=deny action_unknown=newest action_adopt_failure=deny action_generic_failure=deny disable_x11=0' /etc/pam.d/sshd
104106
fi
105107
}

schedmd/slurm/25.05/ubuntu24.04/files/usr/local/bin/slurmd-entrypoint.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ function addConfItem() {
9595
export SLURMD_OPTIONS="${slurmdOptions[*]}"
9696
}
9797

98-
# Configure PAM for pam_slurm_adopt (following login's dynamic pattern)
98+
# configure_pam configures PAM to use pam_slurm_adopt for SSH sessions.
99+
#
100+
# This allows SSH access to be restricted to users with active jobs on the node.
99101
function configure_pam() {
100102
# Add pam_slurm_adopt to SSH PAM configuration if not already present
101103
if ! grep -q "pam_slurm_adopt.so" /etc/pam.d/sshd 2>/dev/null; then

0 commit comments

Comments
 (0)