{
    "mode": "man",
    "parameter": "PAM_PWHISTORY",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/PAM_PWHISTORY/8/json",
    "generated": "2026-05-30T10:06:53Z",
    "synopsis": "pampwhistory.so [debug] [useauthtok] [enforceforroot] [remember=N] [retry=N]\n[authtoktype=STRING]",
    "sections": {
        "NAME": {
            "content": "pampwhistory - PAM module to remember last passwords\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pampwhistory.so [debug] [useauthtok] [enforceforroot] [remember=N] [retry=N]\n[authtoktype=STRING]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module saves the last passwords for each user in order to force password change history\nand keep the user from alternating between the same password too frequently.\n\nThis module does not work together with kerberos. In general, it does not make much sense to\nuse this module in conjunction with NIS or LDAP, since the old passwords are stored on the\nlocal machine and are not available on another machine for password history checking.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "debug",
                    "content": "Turns on debugging via syslog(3).\n\nuseauthtok\nWhen password changing enforce the module to use the new password provided by a\npreviously stacked password module (this is used in the example of the stacking of the\npamcracklib module documented below).\n\nenforceforroot\nIf this option is set, the check is enforced for root, too.\n\nremember=N\nThe last N passwords for each user are saved in /etc/security/opasswd. The default is 10.\nValue of 0 makes the module to keep the existing contents of the opasswd file unchanged.\n\nretry=N\nPrompt user at most N times before returning with error. The default is 1.\n\nauthtoktype=STRING\nSee pamgetauthtok(3) for more details.\n"
                }
            ]
        },
        "MODULE TYPES PROVIDED": {
            "content": "Only the password module type is provided.\n",
            "subsections": []
        },
        "RETURN VALUES": {
            "content": "PAMAUTHTOKERR\nNo new password was entered, the user aborted password change or new password couldn't be\nset.\n\nPAMIGNORE\nPassword history was disabled.\n\nPAMMAXTRIES\nPassword was rejected too often.\n\nPAMUSERUNKNOWN\nUser is not known to system.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "An example password section would be:\n\n#%PAM-1.0\npassword     required       pampwhistory.so\npassword     required       pamunix.so        useauthtok\n\n\nIn combination with pamcracklib:\n\n#%PAM-1.0\npassword     required       pamcracklib.so    retry=3\npassword     required       pampwhistory.so   useauthtok\npassword     required       pamunix.so        useauthtok\n\n\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/security/opasswd\nFile with password history\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pam.conf(5), pam.d(5), pam(7) pamgetauthtok(3)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "pampwhistory was written by Thorsten Kukuk <kukuk@thkukuk.de>\n\n\n\nLinux-PAM Manual                             06/08/2020                             PAMPWHISTORY(8)",
            "subsections": []
        }
    },
    "summary": "pampwhistory - PAM module to remember last passwords",
    "flags": [],
    "examples": [
        "An example password section would be:",
        "#%PAM-1.0",
        "password     required       pampwhistory.so",
        "password     required       pamunix.so        useauthtok",
        "In combination with pamcracklib:",
        "#%PAM-1.0",
        "password     required       pamcracklib.so    retry=3",
        "password     required       pampwhistory.so   useauthtok",
        "password     required       pamunix.so        useauthtok"
    ],
    "see_also": [
        {
            "name": "pam.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pam.conf/5/json"
        },
        {
            "name": "pam.d",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pam.d/5/json"
        },
        {
            "name": "pam",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pam/7/json"
        },
        {
            "name": "pamgetauthtok",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamgetauthtok/3/json"
        }
    ]
}