{
    "mode": "man",
    "parameter": "PAM_UNIX",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/PAM_UNIX/8/json",
    "generated": "2026-10-06T11:19:55Z",
    "synopsis": "pamunix.so [...]",
    "sections": {
        "NAME": {
            "content": "pamunix - Module for traditional password authentication\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pamunix.so [...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is the standard Unix authentication module. It uses standard calls from the system's\nlibraries to retrieve and set account information as well as authentication. Usually this is\nobtained from the /etc/passwd and the /etc/shadow file as well if shadow is enabled.\n\nThe account component performs the task of establishing the status of the user's account and\npassword based on the following shadow elements: expire, lastchange, maxchange, minchange,\nwarnchange. In the case of the latter, it may offer advice to the user on changing their\npassword or, through the PAMAUTHTOKENREQD return, delay giving service to the user until\nthey have established a new password. The entries listed above are documented in the\nshadow(5) manual page. Should the user's record not contain one or more of these entries, the\ncorresponding shadow check is not performed.\n\nThe authentication component performs the task of checking the users credentials (password).\nThe default action of this module is to not permit the user access to a service if their\nofficial password is blank.\n\nA helper binary, unixchkpwd(8), is provided to check the user's password when it is stored\nin a read protected database. This binary is very simple and will only check the password of\nthe user invoking it. It is called transparently on behalf of the user by the authenticating\ncomponent of this module. In this way it is possible for applications like xlock(1) to work\nwithout being setuid-root. The module, by default, will temporarily turn off SIGCHLD handling\nfor the duration of execution of the helper binary. This is generally the right thing to do,\nas many applications are not prepared to handle this signal from a child they didn't know was\nfork()d. The noreap module argument can be used to suppress this temporary shielding and may\nbe needed for use with certain applications.\n\nThe maximum length of a password supported by the pamunix module via the helper binary is\nPAMMAXRESPSIZE - currently 512 bytes. The rest of the password provided by the\nconversation function to the module will be ignored.\n\nThe password component of this module performs the task of updating the user's password. The\ndefault encryption hash is taken from the ENCRYPTMETHOD variable from /etc/login.defs\n\nThe session component of this module logs when a user logins or leave the system.\n\nRemaining arguments, supported by others functions of this module, are silently ignored.\nOther arguments are logged as errors through syslog(3).\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "debug\nTurns on debugging via syslog(3).\n\naudit\nA little more extreme than debug.\n\nquiet\nTurns off informational messages namely messages about session open and close via\nsyslog(3).\n\nnullok\nThe default action of this module is to not permit the user access to a service if their\nofficial password is blank. The nullok argument overrides this default.\n\nnullresetok\nAllow users to authenticate with blank password if password reset is enforced even if\nnullok is not set. If password reset is not required and nullok is not set the\nauthentication with blank password will be denied.\n\ntryfirstpass\nBefore prompting the user for their password, the module first tries the previous stacked\nmodule's password in case that satisfies this module as well.\n\nusefirstpass\nThe argument usefirstpass forces the module to use a previous stacked modules password\nand will never prompt the user - if no password is available or the password is not\nappropriate, the user will be denied access.\n\nnodelay\nThis argument can be used to discourage the authentication component from requesting a\ndelay should the authentication as a whole fail. The default action is for the module to\nrequest a delay-on-failure of the order of two second.\n\nuseauthtok\nWhen password changing enforce the module to set the new password to the one provided by\na previously stacked password module (this is used in the example of the stacking of the\npampasswdqc module documented below).\n\nauthtoktype=type\nThis argument can be used to modify the password prompt when changing passwords to\ninclude the type of the password. Empty by default.\n\nnis\nNIS RPC is used for setting new passwords.\n\nremember=n\nThe last n passwords for each user are saved in /etc/security/opasswd in order to force\npassword change history and keep the user from alternating between the same password too\nfrequently. The MD5 password hash algorithm is used for storing the old passwords.\nInstead of this option the pampwhistory module should be used.\n\nshadow\nTry to maintain a shadow based system.\n\nmd5\nWhen a user changes their password next, encrypt it with the MD5 algorithm.\n\nbigcrypt\nWhen a user changes their password next, encrypt it with the DEC C2 algorithm.\n\nsha256\nWhen a user changes their password next, encrypt it with the SHA256 algorithm. The SHA256\nalgorithm must be supported by the crypt(3) function.\n\nsha512\nWhen a user changes their password next, encrypt it with the SHA512 algorithm. The SHA512\nalgorithm must be supported by the crypt(3) function.\n\nblowfish\nWhen a user changes their password next, encrypt it with the blowfish algorithm. The\nblowfish algorithm must be supported by the crypt(3) function.\n\ngostyescrypt\nWhen a user changes their password next, encrypt it with the gost-yescrypt algorithm. The\ngost-yescrypt algorithm must be supported by the crypt(3) function.\n\nyescrypt\nWhen a user changes their password next, encrypt it with the yescrypt algorithm. The\nyescrypt algorithm must be supported by the crypt(3) function.\n\nrounds=n\nSet the optional number of rounds of the SHA256, SHA512, blowfish, gost-yescrypt, and\nyescrypt password hashing algorithms to n.\n\nbrokenshadow\nIgnore errors reading shadow information for users in the account management module.\n\nminlen=n\nSet a minimum password length of n characters. The default value is 6. The maximum for\nDES crypt-based passwords is 8 characters.\n",
            "subsections": [
                {
                    "name": "obscure",
                    "content": "Enable some extra checks on password strength. These checks are based on the \"obscure\"\nchecks in the original shadow package. The behavior is similar to the pamcracklib\nmodule, but for non-dictionary-based checks. The following checks are implemented:\n\nPalindrome\nVerifies that the new password is not a palindrome of (i.e., the reverse of) the\nprevious one.\n\nCase Change Only\nVerifies that the new password isn't the same as the old one with a change of case.\n\nSimilar\nVerifies that the new password isn't too much like the previous one.\n\nSimple\nIs the new password too simple? This is based on the length of the password and the\nnumber of different types of characters (alpha, numeric, etc.) used.\n\nRotated\nIs the new password a rotated version of the old password? (E.g., \"billy\" and\n\"illyb\")\n\n\nnopassexpiry\nWhen set ignore password expiration as defined by the shadow entry of the user. The\noption has an effect only in case pamunix was not used for the authentication or it\nreturned authentication failure meaning that other authentication source or method\nsucceeded. The example can be public key authentication in sshd. The module will return\nPAMSUCCESS instead of eventual PAMNEWAUTHTOKREQD or PAMAUTHTOKEXPIRED.\n\nInvalid arguments are logged with syslog(3).\n"
                }
            ]
        },
        "MODULE TYPES PROVIDED": {
            "content": "All module types (account, auth, password and session) are provided.\n",
            "subsections": []
        },
        "RETURN VALUES": {
            "content": "PAMIGNORE\nIgnore this module.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "An example usage for /etc/pam.d/login would be:\n\n# Authenticate the user\nauth       required   pamunix.so\n# Ensure users account and password are still active\naccount    required   pamunix.so\n# Change the user's password, but at first check the strength\n# with pampasswdqc(8)\npassword   required   pampasswdqc.so config=/etc/passwdqc.conf\npassword   required   pamunix.so useauthtok nullok yescrypt\nsession    required   pamunix.so\n\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "login.defs(5), pam.conf(5), pam.d(5), pam(7)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "pamunix was written by various people.\n\nLinux-PAM                                    05/07/2023                                  PAMUNIX(8)",
            "subsections": []
        }
    },
    "summary": "pamunix - Module for traditional password authentication",
    "flags": [],
    "examples": [
        "An example usage for /etc/pam.d/login would be:",
        "# Authenticate the user",
        "auth       required   pamunix.so",
        "# Ensure users account and password are still active",
        "account    required   pamunix.so",
        "# Change the user's password, but at first check the strength",
        "# with pampasswdqc(8)",
        "password   required   pampasswdqc.so config=/etc/passwdqc.conf",
        "password   required   pamunix.so useauthtok nullok yescrypt",
        "session    required   pamunix.so"
    ],
    "see_also": [
        {
            "name": "login.defs",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/login.defs/5/json"
        },
        {
            "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"
        }
    ]
}