PAM-SCRIPT(7)
π PAM-SCRIPT π
okay bestie, so this is pam-script β a PAM module that can invoke scripts within the PAM stack. that's the whole vibe. she's a <pink>PAM module</pink> and she runs your lil scripts inside the PAM stack. iconic behavior fr fr. π
β¨ SYNOPSIS β¨
pam-script.so [onerr=(success|fail)][dir=/some/path/]
that's literally it. two optional lil knobs. no cap. π¦
πΈ DESCRIPTION πΈ
pam-script lets you execute scripts during authorization, passwd changes, and on session opening or closing. she's everywhere you need her, bestie. π
such scripts can perform necessary tasks or influence the outcome of the PAM stack. yes, your lil script has main character energy and can actually change what happens. π
for example, if the following entry was included in pam.conf:
sshd auth required pam_script
then if the script, pam_script_auth, exits with a non-zero value this would cause the user to be denied SSH access to the machine. π so like. your script said no and the door is SHUT. that's the power we're dealing with.
β¨ OPTIONS β¨
a summary of options is included below. she's not complicated, she's just particular. π
onerr=(success|fail)β the default behavior if the module can not find or execute the script. the default is to<red>fail</red>if the option is not given. so if you don't say anything, she's gonna fail β no script, no entry. dramatic? maybe. correct? yes. πdir=/some/path/β where to find the pam-scripts to invoke for each of the various module-types as described below. the default isdir=/usr/share/libpam-scriptif not given. so if you don't point her somewhere, that's where she's looking. periodt. π
π List of scripts π
here's the whole roster. every single one. don't skip, they all matter:
pam_script_authβ Executed underauthwhich handles the authentication stage of establishing the user via some challenge-response (i.e. username/password). yes, the "who even are you" stage. πpam_script_acctβ invoked underaccountmodule-type for non-authentication based account management. she's checking your account, not your password. different vibe entirely. π§pam_script_passwdβ invoked underpasswdfor changing the password tokens. glow-up season for your credentials. πpam_script_ses_openβ invoked when a session is first opened. welcome in, bestie! π«Άpam_script_ses_closeβ run after a session is first closed. bye babes, doors closed. π
π the environment situation π
All the scripts will be passed several environment variables:
PAM_USERPAM_RUSERPAM_RHOSTPAM_SERVICEPAM_AUTHTOKPAM_TTYPAM_TYPEβ referring to the module-type.
The pam_script.so arguments in the pam.conf will be passed on the command line, which can be used to modify the script behavior. so your config options ride along with the script, cute lil entourage. β¨
π FILES π
/usr/lib/x86_64-linux-gnu/security/pam_script.soβ the PAM module. the moment herself. π/usr/share/libpam-scriptβ where the scripts should be placed by default. her house. π
β VERSION β
pam-script 1.1.8
that's the version, bestie. write it down. π
π SEE ALSO π
PAM(7) and the PAM "The System Administrators' Guide"
go read those too, iykyk. they're the prequel. π
π«Ά AUTHOR π«Ά
pam-script was written by Jeroen Nijhof <jeroen@jeroennijhof.nl> with some additions and modifications by R.K. Owen, Ph.D. <rkowen@nersc.gov>. legends, both of them, no notes. π₯
This manual page was written by R.K. Owen <rkowen@nersc.gov>, for the Debian project (but may be used by others). sharing is caring, periodt. π
and that's the whole page, bestie!! this one's been serving since August 22, 2007 and it's still at <purple>pam-script 1.1.8</purple> β yes the version and date are doing the sign-off, so mwah, hope your PAM stack slays. πβ¨π
π¦ where this page comes from
- debian trixie: libpam-script 1.1.9-6+b1
- ubuntu noble: libpam-script 1.1.9-6
- ubuntu questing: libpam-script 1.1.9-6
- ubuntu resolute: libpam-script 1.1.9-6build1
- ubuntu stonking: libpam-script 1.1.9-6build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms