pam_oar_adopt(8)
π pam_oar_adopt(8) β the OAR commands era π
okay bestie, sit down, grab a boba π§, because we're talking about pam_oar_adopt β it's a <rainbow>pam_exec</rainbow> script from the OAR commands fam, and its whole job is managing ssh connections to OAR nodes. lowkey iconic. no cap. π«Ά
β¨ NAME β¨
pam_oar_adopt β OAR's <cyan>pam_exec</cyan> script that manages ssh connections to OAR nodes π
πΈ SYNOPSIS πΈ
pam_oar_adopt -a for PAM account
pam_oar_adopt -s for PAM session
like, that's it. two modes. <hotpink>-a</hotpink> for the PAM account era, <hotpink>-s</hotpink> for the PAM session era. pick your fighter. π
π¦ DESCRIPTION π¦
so this script? it's part of the OAR resources and jobs manager software. it's not out here doing its own thing, it's on the team. π
PAM can be configured to let users <cyan>ssh</cyan> β and we mean basic ssh, not via <cyan>oarsh</cyan> β onto OAR nodes, and then it takes the processes that get created and plops them right into the job's cgroup. πͺ it will also prevent any ssh connection to nodes that aren't properly reserved. gatekeeping, but make it infrastructure.
this whole situation uses the <hotpink>pam_exec</hotpink> module together with the <hotpink>pam_oar_adopt</hotpink> script, plus the <hotpink>pam_env</hotpink> module. a little trio. a little squad. π«Ά
once it's enabled, here's the vibe: if a user has reserved a node and then connects to it using ssh, PAM will find out the job's cgroup and place the ssh remote process in it. yes ma'am, correct cgroup, first try. β¨ it will also load the job's environment variables. so the environment? immaculate. π
now the part where the connection just fails π β if a user tries to ssh to a node that is:
- not reserved, or
- not reserved in full (like, all compute resources of the node must be reserved β no crumbs left over), or
- reserved multiple times (e.g. 2 different jobs reserving each a subset of the node's compute resources, or using the
<purple>timesharing</purple>job type)
β¦then bestie, the connection will fail. it's giving "you shall not pass". π
please note that while using ssh is very convenient,<cyan>oarsh</cyan>provides extra features to connect to jobs. so like, ssh is the easy route, but oarsh is the main character. π
π CONFIGURATION π
to enable this feature, one must configure <pink>pam_oar_adopt</pink> in PAM and activate it in its configuration file (/etc/oar/pam_oar_adopt.conf). both. not one. both. π
π PAM CONFIGURATION
make sure the ssh service β and we mean the one on port 22, not OAR's dedicated ssh service on port 6667 β enables PAM. /etc/ssh/sshd_config must contain:
UsePAM yes
periodt. π
follows an example of configuration of PAM with <pink>pam_oar_adopt</pink> on Debian-like systems:
/etc/pam.d/common-accountβ the following can be set as the first PAM directive incommon-account:
account required pam_exec.so quiet stdout /usr/sbin/pam_oar_adopt -a
/etc/pam.d/common-sessionand/etc/pam.d/common-session-noninteractiveβ the following can be set as the last PAM directives incommon-sessionandcommon-session-noninteractive:
session required pam_exec.so quiet stdout /usr/sbin/pam_oar_adopt -s
session optional pam_env.so readenv=1 envfile=/var/lib/oar/pam.env
on Debian-like systems, one can also use the <cyan>pam-auth-update</cyan> command to configure PAM and, by default, this PAM profile is installed with the <purple>oar-node</purple> package. convenient? yes. slay? also yes. β¨
π PAM_OAR_ADOPT CONFIGURATION π
the /etc/oar/pam_oar_adopt.conf file contains the following configuration options:
MODEβ whetherpam_oar_adoptis enabled or not. possible values are:enforced:pam_oar_adoptis enabled and will prevent any ssh connection to nodes that are not properly reserved.disabled:pam_oar_adoptis disabled.
by default, pam_oar_adopt is disabled. π΄
[DEPRECATED] for compatibility reasons, if the/etc/oar/pam_oar_adopt_enabledfile exists, regardless of/etc/oar/pam_oar_adopt.conf, thenpam_oar_adoptis enabled. so yeah, that file overrides everything. deprecated but still out here acting up. π
WARNβ in disabled mode,pam_oar_adoptwill warn users about what would have been done if it was enabled. possible values are:yes: warn users (default).no: do not warn users aboutpam_oar_adoptdoing nothing.
USER_UID_MINβ in enforced mode,pam_oar_adoptwill ignore (not prevent) ssh connections from users with a UID lower thanUSER_UID_MIN. this is useful to allow system users to connect to nodes without being part of a job. the default value is1000.
π₯ NOTES π₯
it is a good practice to prevent users to connect to OAR nodes outside of jobs (except system users: at least root and the oar user). like, boundaries, bestie. π«Ά
configuring pam_oar_adopt does it, but it can also be enforced using <cyan>pam_access</cyan> or the AllowedUsers directive in /etc/ssh/sshd_config. multiple ways to secure the vibes. π
conversely β flip it β in an installation where either of OAR's <purple>deploy</purple> or <purple>cosystem</purple> job types is used, which requires the oar-node package to also be installed on the deploy or cosystem frontend, it is usually normal to let any user ssh to that frontend regardless of jobs. so like, everyone's welcome there. π as a result on such a frontend, pam_oar_adopt should not be installed (on Debian-like systems, one may use pam-auth-update to deactivate the oar-node PAM profile). don't install it there, fr fr. π«
π SEE ALSO π
pam(7)pam.conf(5)pam.d(5)pam_exec(8)pam_env(7)pam_access(8)pam-auth-update(8)ssh(1)sshd_config(5)oarsh(1)
go read the whole friend group, they're all linked. iykyk. π
π COPYRIGHTS π
Copyright 2003-2025 Laboratoire d'Informatique de Grenoble (http://www.liglab.fr). This software is licensed under the GNU General Public License Version 2 or above. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
okay so real talk: NO warranty β not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. read it, internalize it, respect it. π
and that's the whole page, bestie! π this was pam_oar_adopt from OAR commands, dated 2025-03-24. now go configure your PAM and be the main character of your cluster. mwah. π
β¨π¦
π¦ where this page comes from
- debian trixie: oar-node 2.6.1-1 Β· GPL-2.0-or-later
- ubuntu questing: oar-node 2.6.1-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms