Revert "Remove pam_slurm_adopt from fox"
This reverts commit 64a52801ed8d5c4a57650c2c434254a9986c1901. Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
This commit is contained in:
		
							parent
							
								
									8ebc51b33e
								
							
						
					
					
						commit
						333e24d80b
					
				| @ -95,4 +95,20 @@ | |||||||
|     wantedBy = [ "multi-user.target" ]; |     wantedBy = [ "multi-user.target" ]; | ||||||
|     serviceConfig.ExecStart = script; |     serviceConfig.ExecStart = script; | ||||||
|   }; |   }; | ||||||
|  | 
 | ||||||
|  |   # Only allow SSH connections from users who have a SLURM allocation | ||||||
|  |   # See: https://slurm.schedmd.com/pam_slurm_adopt.html | ||||||
|  |   security.pam.services.sshd.rules.account.slurm = { | ||||||
|  |     control = "required"; | ||||||
|  |     enable = true; | ||||||
|  |     modulePath = "${pkgs.slurm}/lib/security/pam_slurm_adopt.so"; | ||||||
|  |     args = [ "log_level=debug5" ]; | ||||||
|  |     order = 999999; # Make it last one | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   # Disable systemd session (pam_systemd.so) as it will conflict with the | ||||||
|  |   # pam_slurm_adopt.so module. What happens is that the shell is first adopted | ||||||
|  |   # into the slurmstepd task and then into the systemd session, which is not | ||||||
|  |   # what we want, otherwise it will linger even if all jobs are gone. | ||||||
|  |   security.pam.services.sshd.startSession = lib.mkForce false; | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user