PAM_PWHISTORY(8)
๐ PAM_PWHISTORY ๐
okay bestie, welcome to pam_pwhistory โ it's a Linux-PAM manual page and it's literally the bouncer at the password club ๐
โจ NAME โจ
pam_pwhistory โ the PAM module that remembers your last passwords (yes, all of them, it's keeping receipts ๐
)
โจ SYNOPSIS โจ
pam_pwhistory.so [debug] [use_authtok] [enforce_for_root] [remember=N]
[retry=N] [authtok_type=STRING] [file=/path/filename]
[conf=/path/to/config-file]
โจ DESCRIPTION โจ
So basically this module keeps the last passwords of each user on file so it can force a password change history and stop people from just vibing back and forth between the same two passwords forever. It's giving "you can't sit with us" but for your old password ๐ธ
Important: this module does not work together with kerberos. And honestly? Using it with NIS or LDAP doesn't make much sense either, because the old passwords live on the local machine and are not available on another machine for password history checking. So like, the lore only exists locally, no cap ๐ซถ
โจ OPTIONS โจ
debugโ turns on debugging viasyslog(3). Very "let me see what's happening in here" energy ๐use_authtokโ when you're changing a password, this forces the module to use the new password that a previously stacked password module handed over. (This is exactly what's happening in the stacking example withpam_passwdqcdown below, iykyk.)enforce_for_rootโ if you set this, the check gets enforced for root too. No exceptions, no nepo baby privilege ๐remember=Nโ the last N passwords for each user get saved. Default is10. And listen โ a value of0makes the module keep the existing contents of theopasswdfile unchanged. Like, untouched, frozen, periodt.retry=Nโ prompt the user at most N times before it returns with an error. Default is1. One shot, one opportunity ๐ฏauthtok_type=STRINGโ go readpam_get_authtok(3)for more details on this one bestie.file=/path/filenameโ store the password history in/path/filenameinstead of the default location. The default location is/etc/security/opasswd๐conf=/path/to/config-fileโ use another configuration file instead of the default/etc/security/pwhistory.conf.
The options for configuring the module behavior are described in the pwhistory.conf(5) manual page. And here's the tea: the options specified on the module command line override the values from the configuration file. Command line wins, always ๐
โจ MODULE TYPES PROVIDED โจ
Only the password module type is provided. That's it. That's the whole list. She's specialized ๐
โจ RETURN VALUES โจ
PAM_AUTHTOK_ERRโ no new password was entered, the user aborted the password change, or the new password couldn't be set. It's giving "never mind, forget it" ๐ญPAM_IGNOREโ password history was disabled. The module said "not my problem today" ๐PAM_MAXTRIESโ password was rejected too often. Too many tries, bestie, the door is closed ๐ฅPAM_USER_UNKNOWNโ user is not known to system. Who? Never heard of her ๐
โจ EXAMPLES โจ
An example password section would be:
#%PAM-1.0
password required pam_pwhistory.so
password required pam_unix.so use_authtok
And in combination with pam_passwdqc:
#%PAM-1.0
password required pam_passwdqc.so config=/etc/passwdqc.conf
password required pam_pwhistory.so use_authtok
password required pam_unix.so use_authtok
Look at that stacking. Iconic behavior, honestly ๐
โจ FILES โจ
/etc/security/opasswdโ default file with password history ๐๏ธ/etc/security/pwhistory.confโ config file forpam_pwhistoryoptions โ๏ธ
โจ SEE ALSO โจ
pwhistory.conf(5), pam.conf(5), pam.d(5), pam(8), pam_get_authtok(3)
Go read them, they're all part of the same friend group ๐ฆ
โจ AUTHOR โจ
pam_pwhistory was written by Thorsten Kukuk <kukuk@thkukuk.de> โ king behavior, we stan ๐
and that's the whole page bestie!! this was the Linux-PAM Manual's PAM_PWHISTORY(8), and the footer tea is: <b>Linux-PAM</b>, dated <b>09/27/2026</b> ๐ mwah, go change your password (to something new, obviously, the module is watching ๐ โจ)
๐ฆ where this page comes from
- arch rolling: pam 1.7.3-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms