PAM-SCRIPT(8)

πŸ“¦ version 1.1.9, in opensuse-leap 16.0

πŸ’… NAME

okay so bestie, <pink>pam-script</pink> is a PAM module that can invoke scripts within the PAM stack ✨ β€” that's it, that's the whole vibe.


🌸 SYNOPSIS

pam-script.so [onerr=(success|fail)][dir=/some/path/]

πŸ¦‹ DESCRIPTION

pam-script lets you execute scripts during authorization, passwd changes, and on session opening or closing. literally so many moments πŸŽ€

Those scripts can do the necessary tasks or influence the outcome of the PAM stack β€” highkey powerful. 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. 😭 no SSH for them, it's giving locked out.


✨ OPTIONS ✨

a summary of options is included below 🫢

  • onerr=(success|fail) β€” the default behavior if the module can not find or execute the script. The default is to fail if the option is not given. 🫑
  • dir=/some/path/ β€” where to find the pam-scripts to invoke for each of the various module-types as described below. The default is dir=/etc if not given.

πŸŽ€ List of scripts

  • pam_script_auth β€” executed under auth which handles the authentication stage of establishing the user via some challenge-response (i.e. username/password).
  • pam_script_acct β€” invoked under the account module-type for non-authentication based account management.
  • pam_script_passwd β€” invoked under passwd for changing the password tokens.
  • pam_script_ses_open β€” invoked when a session is first opened.
  • pam_script_ses_close β€” run after a session is first closed.

All the scripts will be passed several environment variables: PAM_USER, PAM_RUSER, PAM_RHOST, PAM_SERVICE, PAM_AUTHTOK, PAM_TTY, and PAM_TYPE referring to the module-type. πŸ”₯ and 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. iykyk.


🐚 FILES

  • /usr/lib64/security/pam_script.so β€” the PAM module
  • /etc β€” where the scripts should be placed by default

⭐ VERSION

pam-script 1.1.8 πŸ‘‘

πŸ‘€ SEE ALSO

PAM(8) and the PAM "The System Administrators' Guide"

πŸ’œ 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>.

This manual page was written by R.K. Owen <rkowen@nersc.gov>, for the Debian project (but may be used by others).


k so that's the whole page fr fr πŸ’– it's from the Linux-PAM Manual, dated August 22, 2007 β€” vintage but iconic 🌈 slay, go write some scripts bestie πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from