PAM_TCB(8)
π NAME π
Okay so from the System Manager's Manual, this is the PAM_TCB(8) page, and the main character is pam_tcb β the authentication, account, session, and password management PAM module for Unix with support for the tcb password shadowing scheme. Itβs giving all four PAM management groups, no cap. π
β¨ DESCRIPTION β¨
pam_tcb is a PAM module which deals with Unix accounts and provides functionality for all four PAM management groups: authentication, account management, session management, and password management. It is a successor to pam_unix and pam_pwdb. Iconic lineage, honestly. π
π authentication π
For authentication, pam_tcb relies exclusively on the getpwnam(3) and getspnam(3) interfaces to obtain information necessary for user authentication. It performs password hashing with crypt_ra(3) or crypt(3). This means that pam_tcb will use NSS and will handle any password hashing method supported by the system libraries. Slay. π¦
π§Ύ account management π§Ύ
When the account information is available via getspnam(3), the account management part of pam_tcb checks for expired accounts or passwords. It uses the shadow file entry fields as described in shadow(5). It is responsibility of applications to interpret the PAM error status and possibly invoke the password management group to get an expired password changed. Lowkey important, bestie. π
πΈ session management πΈ
By default, pam_tcb logs the opening and closing of PAM sessions via syslog(3). It uses LOG_AUTH as the syslog facility and either adds "pam_tcb: " prefix to log messages or, if the openlog option is given, sets the ident to "pam_tcb". This functionality may be disabled with the nolog option (see below). Logging with main character energy. π
ποΈ password management ποΈ
pam_chauthtok(3) performs two passes through the password management stack: PAM_PRELIM_CHECK and PAM_UPDATE_AUTHTOK. During the PAM_PRELIM_CHECK phase, pam_tcb may optionally prompt for and will always verify the old password. This allows for stacking of a password policy enforcement module such as pam_passwdqc before pam_tcb, without requiring this other module to take over performing any of the tasks of pam_tcb. The actual password change happens during the PAM_UPDATE_AUTHTOK phase. Two passes, one iconic workflow. π₯
When changing passwords, pam_tcb is able to modify the following password databases:
/etc/passwdfile, seepasswd(5);/etc/shadowfile, seeshadow(5);/etc/tcb/directory structure, seetcb(5).
π OPTIONS π
Most of the options recognized by pam_unix or pam_pwdb are valid for pam_tcb as well and have identical meaning. There are some semantic differences though, so you are advised to browse the list below. Donβt skim, bestie β this is the reading assignment. π
All the boolean options are off by default. The default values of non-boolean options are given.
debugβ log debugging information viasyslog(3).auditβ log even more debugging information, including unknown usernames. β οΈ This has the risk of potentially logging a password that a user could have given instead of a username.openlogβ normally,pam_tcbwill add"pam_tcb: "prefix to log messages. Theopenlogoption disables this behavior and causespam_tcbto callopenlog(3)with ident"pam_tcb"before logging andcloselog(3)afterwards.noopenlogβ ifpam_tcbwas compiled withENABLE_OPENLOG, it will callopenlog(3)with ident"pam_tcb"before logging andcloselog(3)afterwards. Thenoopenlogoption disables this behavior.nologβ suppress logging.blank_nologβ do not log failed authentication attempts when a blank password is tried. If this option is not used, some services, notablysshd(8), may generate false alarms.nullokβ permit blank passwords.use_first_passβ donβt prompt the user for passwords; take them fromPAM_AUTHTOKand possiblyPAM_OLDAUTHTOKitems instead.try_first_passβ take passwords fromPAM_AUTHTOKand possiblyPAM_OLDAUTHTOKitems, but prompt the user if the appropriate PAM item is unset.use_authtokβ likeuse_first_pass, but applies to the (new)PAM_AUTHTOKonly. This is intended for stacking password management modules.authtok_type=β this option can be used to modify the password prompt when changing passwords to include the type of the password. The default is empty.likeauthβ when called as a credential setting module, return the same value as was returned during the authentication.passwdβ if set,pam_tcbmay use the second field of userβs"passwd"entry (usually taken from/etc/passwd) as the password hash. See below for details.shadowβ if set,pam_tcbmay use the second field of userβs"shadow"entry (usually taken from/etc/shadowor a tcb shadow file) as the password hash. See below for details.write_to=β this option determines wherepam_tcbshould store new password hashes when changing passwords. Possible settings are:"passwd","shadow", and"tcb". The default is"shadow".md5β when updating a userβs password, hash the new password with the obsolete FreeBSD-derived MD5-based algorithm.prefix=β when updating a userβs password, generate the salt with the specified prefix (which determines the hashing method to use). Unless the underlying libcrypt library implements a default hashing method, the default is"$2b$", which requests bcrypt, a Blowfish-based hashing method, which supports variable iteration counts.count=β the number of iterations of an underlying cryptographic primitive to use when hashing passwords. The default is0, which lets the selected hashing algorithm pick its default iteration count.
It is highly recommended that you override this setting. Please refer to crypt(3) for information on supported hashing methods, their prefix strings, and their count settings.
plain_cryptβ use plaincrypt(3)instead ofcrypt_ra(3). This may be required to access hashing methods for which no reentrant implementation exists in the system libraries.nodelayβ do not delay after an unsuccessful authentication attempt.forkβ create child processes for accessing shadow files. Using this option one can be sure that after a call topam_end(3)there is no sensitive data left in the processβ address space. However, this option may confuse some of the more complicated applications and it has some performance overhead.helper=β if the hashed password cannot be retrieved bypam_tcband the UID of the user being authenticated is equal to the real UIDpam_tcbruns as,pam_tcbwill execute a privileged helper program to perform authentication. This option determines path to the programβs binary. If an empty helper path is given, no helper will be executed. The default is/usr/libexec/chkpwd/tcb_chkpwd.
π¦ OBTAINING PASSWORD HASHES π¦
The following algorithm is used by pam_tcb to retrieve the password hash for a user:
if (passwd option is set and pw_passwd field is not equal to "x" nor
"*NP*")
use pw_passwd field as the hash;
if (shadow option is set and pw_passwd field is equal to "x")
use sp_pwdp field as the hash;
if all the above failed, fail.
π BUGS π
The currentpam_tcbimplementation is not thread-safe (just likepam_unixandpam_pwdb). Read that again, bestie. π
π SEE ALSO π
crypt(3)crypt_ra(3)getpwnam(3)getspnam(3)shadow(3)login.defs(5)passwd(5)shadow(5)tcb(5)pam(8)tcb_convert(8)
π Thatβs the whole PAM_TCB(8) page from the System Managerβs Manual β brought to you by the Openwall Project, dated July 17, 2011. Stay safe, bestie! π«Ά
π¦ where this page comes from
- nixpkgs unstable: tcb 1.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms