1 pam_unix — Module for traditional password authentication
3 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
7 This is the standard Unix authentication module. It uses standard calls from
8 the system's libraries to retrieve and set account information as well as
9 authentication. Usually this is obtained from the /etc/passwd and the /etc/
10 shadow file as well if shadow is enabled.
12 The account component performs the task of establishing the status of the
13 user's account and password based on the following shadow elements: expire,
14 last_change, max_change, min_change, warn_change. In the case of the latter, it
15 may offer advice to the user on changing their password or, through the
16 PAM_AUTHTOKEN_REQD return, delay giving service to the user until they have
17 established a new password. The entries listed above are documented in the
18 shadow(5) manual page. Should the user's record not contain one or more of
19 these entries, the corresponding shadow check is not performed.
21 The authentication component performs the task of checking the users
22 credentials (password). The default action of this module is to not permit the
23 user access to a service if their official password is blank.
25 A helper binary, unix_chkpwd(8), is provided to check the user's password when
26 it is stored in a read protected database. This binary is very simple and will
27 only check the password of the user invoking it. It is called transparently on
28 behalf of the user by the authenticating component of this module. In this way
29 it is possible for applications like xlock(1) to work without being
30 setuid-root. The module, by default, will temporarily turn off SIGCHLD handling
31 for the duration of execution of the helper binary. This is generally the right
32 thing to do, as many applications are not prepared to handle this signal from a
33 child they didn't know was fork()d. The noreap module argument can be used to
34 suppress this temporary shielding and may be needed for use with certain
37 The password component of this module performs the task of updating the user's
40 The session component of this module logs when a user logins or leave the
43 Remaining arguments, supported by others functions of this module, are silently
44 ignored. Other arguments are logged as errors through syslog(3).
50 Turns on debugging via syslog(3).
54 A little more extreme than debug.
58 The default action of this module is to not permit the user access to a
59 service if their official password is blank. The nullok argument overrides
64 Before prompting the user for their password, the module first tries the
65 previous stacked module's password in case that satisfies this module as
70 The argument use_first_pass forces the module to use a previous stacked
71 modules password and will never prompt the user - if no password is
72 available or the password is not appropriate, the user will be denied
77 This argument can be used to discourage the authentication component from
78 requesting a delay should the authentication as a whole fail. The default
79 action is for the module to request a delay-on-failure of the order of two
84 When password changing enforce the module to set the new password to the
85 one provided by a previously stacked password module (this is used in the
86 example of the stacking of the pam_cracklib module documented below).
90 This argument is used to inform the module that it is not to pay attention
91 to/make available the old or new passwords from/to other (stacked) password
96 NIS RPC is used for setting new passwords.
100 The last n passwords for each user are saved in /etc/security/opasswd in
101 order to force password change history and keep the user from alternating
102 between the same password too frequently. Instead of this option the
103 pam_pwhistory module should be used.
107 Try to maintain a shadow based system.
111 When a user changes their password next, encrypt it with the MD5 algorithm.
115 When a user changes their password next, encrypt it with the DEC C2
120 When a user changes their password next, encrypt it with the SHA256
121 algorithm. If the SHA256 algorithm is not known to the crypt(3) function,
126 When a user changes their password next, encrypt it with the SHA512
127 algorithm. If the SHA512 algorithm is not known to the crypt(3) function,
132 When a user changes their password next, encrypt it with the blowfish
133 algorithm. If the blowfish algorithm is not known to the crypt(3) function,
138 Set the optional number of rounds of the SHA256, SHA512 and blowfish
139 password hashing algorithms to n.
143 Ignore errors reading shadow information for users in the account
148 Set a minimum password length of n characters. The max. for DES crypt based
149 passwords are 8 characters.
151 Invalid arguments are logged with syslog(3).
155 An example usage for /etc/pam.d/login would be:
157 # Authenticate the user
158 auth required pam_unix.so
159 # Ensure users account and password are still active
160 account required pam_unix.so
161 # Change the users password, but at first check the strength
162 # with pam_cracklib(8)
163 password required pam_cracklib.so retry=3 minlen=6 difok=3
164 password required pam_unix.so use_authtok nullok md5
165 session required pam_unix.so
170 pam_unix was written by various people.