PAM_MATRIX(8)
β¨ NAME β¨
pam_matrix β a PAM test module to retrieve module-specific PAM items π
πΈ SYNOPSIS πΈ
pam_matrix.so [...]
π¦ DESCRIPTION π¦
okay so bestie, here's the deal: testing a PAM application usually means setting up a whole authentication backend, and that's so much effort for literally no reason π. That's where pam_matrix comes in β it lets you authenticate against a plain key-value text file, and you can hand it over either with an option or with an environment variable. iconic behaviour, honestly π
π¨ IMPORTANT π¨
pam_matrix is a test tool. It should be considered completely insecure and never used outside test environments! π
fr fr β and as you'll see when you read through the options and actions, a bunch of them make absolutely zero sense in the real world. They were added just to make tests possible. Not a single one of them is out here trying to be production-ready, no cap π
π PASSWORD DATABASE π
The pam_matrix module authenticates a user against a plain-text CSV file, and the format of the file goes like this:
username:password:allowed_service
Example: User bob allowed to authenticate with the service sshd
bob:secret:sshd
slay, that's the whole vibe π
π OPTIONS π
passdb=/path/to/fileβ the patch to the password database. If the database is not provided with this module option,pam_matrix.soreads thePAM_MATRIX_PASSWDenvironment variable and tries to load the file from there. And if that fails as well,PAM_AUTHINFO_UNAVAILis returned. πechoβ if this option is provided,pam_matrix.sowill ask for password usingPAM_PROMPT_ECHO_ON, that is, the password will be echoed back to user. This option was added to make it possible to test conversation functions better. πverboseβ if this option is provided,pam_matrix.sowill display aPAM_TEXT_INFOmessage when authentication succeeds and aPAM_ERROR_MSGwhen authentication fails. This option was added to make it possible to test conversation functions better. β¨
π MODULE TYPES PROVIDED π
All module types (account, auth, password and session) are supported. periodt. π
- The
authmodule searches for the user in the passdb file and compares the provided password with the one in the passdb file. - The
passwordmodule is able to update the password in the passdb file. - The
accessmodule compares the service name the PAM conversation was invoked with the allowed service for the user as set in the passdb file. - The
sessionmodule sets theHOMEDIRPAM environment variable to"/home/%u"where%ustands for the user who opens the session. The variable is unset on session close.
β EXAMPLE β
auth required pam_matrix.so passdb=/tmp/passdb verbose
account required pam_matrix.so passdb=/tmp/passdb verbose
password required pam_matrix.so passdb=/tmp/passdb verbose
session required pam_matrix.so passdb=/tmp/passdb verbose
and that's the whole page bestie, hope it ate π«Ά this one's dated 2015-11-04, and yeah, it's still out here living under the name PAM_MATRIX(8) β go forth and test responsibly (in a test environment only, please, I'm begging π) π§
π¦ where this page comes from
- arch rolling: pam_wrapper 1.1.8-2 Β· GPL-3.0-or-later
- debian trixie: libpam-wrapper 1.1.7-1+b1 Β· GPL-3.0-or-later
- fedora 43: pam_wrapper 1.1.8-2.fc43 Β· GPL-3.0-or-later
- fedora 43: pam_wrapper 1.1.8-2.fc43 Β· GPL-3.0-or-later
- fedora 44: pam_wrapper 1.1.8-3.fc44 Β· GPL-3.0-or-later
- fedora 44: pam_wrapper 1.1.8-3.fc44 Β· GPL-3.0-or-later
- opensuse-leap 16.0: pam_wrapper 1.1.7-160000.2.2 Β· GPL-3.0-or-later
- opensuse-leap 16.0: pam_wrapper 1.1.7-160000.2.2 Β· GPL-3.0-or-later
- opensuse-leap 16.0: pam_wrapper 1.1.7-160000.2.2 Β· GPL-3.0-or-later
- opensuse-leap 16.0: pam_wrapper 1.1.7-160000.2.2 Β· GPL-3.0-or-later
- ubuntu questing: libpam-wrapper 1.1.7-1build1
- ubuntu resolute: libpam-wrapper 1.1.8-1build1 Β· GPL-3.0-or-later
- ubuntu stonking: libpam-wrapper 1.1.8-1build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms