PAM_USERDB(8)
โจ PAM_USERDB โจ
ok so bestie, welcome to pam_userdb โ it's a Linux-PAM thing, and it's genuinely one of the cutest little modules out there. it does one job and it does it slayfully. let's get into it ๐
๐ธ NAME ๐ธ
pam_userdb โ a PAM module that authenticates against a db database. that's it, that's the whole vibe ๐
๐ฆ SYNOPSIS ๐ฆ
pam_userdb.so db=/path/database [debug] [crypt=[crypt|none]] [icase]
[dump] [try_first_pass] [use_first_pass] [unknown_ok]
[key_only]
๐ DESCRIPTION ๐
okay so here's the tea โ โ the pam_userdb module verifies a username/password pair against values stored in a Berkeley DB database. no cap.
the database is indexed by the username, and the data fields corresponding to the username keys are the passwords. so like, username โ password. simple. iconic. periodt โจ
๐ OPTIONS ๐
crypt=[crypt|none]โ tells the module whether the passwords sitting in the database are encrypted or plaintext. if it'scrypt, the passwords should be stored in the database incrypt(3)form. if you picknone, then the passwords should be stored in the database as plaintext. choose wisely bestie ๐db=/path/databaseโ use the/path/databasedatabase to do the lookup. there is no default, so if you don't provide a database the module will returnPAM_IGNORE. also important: the path to the database file should be specified without the.dbsuffix. yes really. i know. ๐debugโ prints debug information. heads up though: password hashes, both from db and computed, will be printed to syslog. so like... know that before you turn this on ๐ญdumpโ dumps all the entries in the database to the log. > Don't do this by default! (the manpage literally yells this at you, and honestly, valid.)icaseโ makes the password verification case insensitive (ie when working with registration numbers and such). it only works with plaintext password storage. so if you've gotcryptgoing, this does nothing, mwah ๐try_first_passโ uses the authentication token previously obtained by another module that did the conversation with the application. if this token can not be obtained then the module will try to converse. this option can be used for stacking different modules that need to deal with the authentication tokens. so polite of it ๐ซถuse_first_passโ uses the authentication token previously obtained by another module that did the conversation with the application. if this token can not be obtained then the module will fail. this option can be used for stacking different modules that need to deal with the authentication tokens. way more dramatic thantry_first_pass, main character energy fr ๐ฅunknown_okโ do not return error when checking for a user that is not in the database. this can be used to stack more than onepam_userdbmodule that will check a username/password pair in more than a database. so like, chain them up, bestie ๐key_onlyโ the username and password are concatenated together in the database hash as'username-password'with a random value. if the concatenation of the username and password with a dash in the middle returns any result, the user is valid. this is useful in cases where the username may not be unique but the username and password pair are. lowkey galaxy brain ๐
๐ MODULE TYPES PROVIDED ๐
the auth and account module types are provided. just those two, and they serve ๐
๐ RETURN VALUES ๐
PAM_AUTH_ERRโ authentication failure. the classic. ๐ญPAM_AUTHTOK_RECOVERY_ERRโ authentication information cannot be recovered.PAM_BUF_ERRโ memory buffer error.PAM_CONV_ERRโ conversation failure.PAM_SERVICE_ERRโ error in service module.PAM_SUCCESSโ success!! slay โจ๐PAM_USER_UNKNOWNโ user not known to the underlying authentication module. it's giving "who is she" ๐
๐ง EXAMPLES ๐ง
auth sufficient pam_userdb.so icase db=/etc/dbtest
look at her. one line. does the thing. obsessed ๐
๐ SEE ALSO ๐
crypt(3), pam.conf(5), pam.d(5), pam(8)
go read them, iykyk ๐
๐ AUTHOR ๐
pam_userdb was written by Cristian Gafton >gafton@redhat.com<. thank you king ๐
okay that's the whole page bestie, you're so ready for this. this was the Linux-PAM manual, dated 07/08/2026, and it's still filed under PAM_USERDB(8) โ now go forth and authenticate responsibly, mwah ๐โจ๐
๐ฆ where this page comes from
- fedora 44: pam 1.7.2-2.fc44 ยท BSD-3-Clause AND GPL-2.0-or-later
- fedora 44: pam 1.7.2-2.fc44 ยท BSD-3-Clause AND GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms