1PAM_UNIX(8) Linux-PAM Manual PAM_UNIX(8)
2
3
4
6 pam_unix - Module for traditional password authentication
7
9 pam_unix.so [...]
10
12 This is the standard Unix authentication module. It uses standard calls
13 from the system's libraries to retrieve and set account information as
14 well as authentication. Usually this is obtained from the /etc/passwd
15 and the /etc/shadow file as well if shadow is enabled.
16
17 The account component performs the task of establishing the status of
18 the user's account and password based on the following shadow elements:
19 expire, last_change, max_change, min_change, warn_change. In the case
20 of the latter, it may offer advice to the user on changing their
21 password or, through the PAM_AUTHTOKEN_REQD return, delay giving
22 service to the user until they have established a new password. The
23 entries listed above are documented in the shadow(5) manual page.
24 Should the user's record not contain one or more of these entries, the
25 corresponding shadow check is not performed.
26
27 The authentication component performs the task of checking the users
28 credentials (password). The default action of this module is to not
29 permit the user access to a service if their official password is
30 blank.
31
32 A helper binary, unix_chkpwd(8), is provided to check the user's
33 password when it is stored in a read protected database. This binary is
34 very simple and will only check the password of the user invoking it.
35 It is called transparently on behalf of the user by the authenticating
36 component of this module. In this way it is possible for applications
37 like xlock(1) to work without being setuid-root. The module, by
38 default, will temporarily turn off SIGCHLD handling for the duration of
39 execution of the helper binary. This is generally the right thing to
40 do, as many applications are not prepared to handle this signal from a
41 child they didn't know was fork()d. The noreap module argument can be
42 used to suppress this temporary shielding and may be needed for use
43 with certain applications.
44
45 The maximum length of a password supported by the pam_unix module via
46 the helper binary is PAM_MAX_RESP_SIZE - currently 512 bytes. The rest
47 of the password provided by the conversation function to the module
48 will be ignored.
49
50 The password component of this module performs the task of updating the
51 user's password. The default encryption hash is taken from the
52 ENCRYPT_METHOD variable from /etc/login.defs
53
54 The session component of this module logs when a user logins or leave
55 the system.
56
57 Remaining arguments, supported by others functions of this module, are
58 silently ignored. Other arguments are logged as errors through
59 syslog(3).
60
62 debug
63 Turns on debugging via syslog(3).
64
65 audit
66 A little more extreme than debug.
67
68 quiet
69 Turns off informational messages namely messages about session open
70 and close via syslog(3).
71
72 nullok
73 The default action of this module is to not permit the user access
74 to a service if their official password is blank. The nullok
75 argument overrides this default.
76
77 try_first_pass
78 Before prompting the user for their password, the module first
79 tries the previous stacked module's password in case that satisfies
80 this module as well.
81
82 use_first_pass
83 The argument use_first_pass forces the module to use a previous
84 stacked modules password and will never prompt the user - if no
85 password is available or the password is not appropriate, the user
86 will be denied access.
87
88 nodelay
89 This argument can be used to discourage the authentication
90 component from requesting a delay should the authentication as a
91 whole fail. The default action is for the module to request a
92 delay-on-failure of the order of two second.
93
94 use_authtok
95 When password changing enforce the module to set the new password
96 to the one provided by a previously stacked password module (this
97 is used in the example of the stacking of the pam_cracklib module
98 documented below).
99
100 authtok_type=type
101 This argument can be used to modify the password prompt when
102 changing passwords to include the type of the password. Empty by
103 default.
104
105 nis
106 NIS RPC is used for setting new passwords.
107
108 remember=n
109 The last n passwords for each user are saved in
110 /etc/security/opasswd in order to force password change history and
111 keep the user from alternating between the same password too
112 frequently. The MD5 password hash algorithm is used for storing the
113 old passwords. Instead of this option the pam_pwhistory module
114 should be used.
115
116 shadow
117 Try to maintain a shadow based system.
118
119 md5
120 When a user changes their password next, encrypt it with the MD5
121 algorithm.
122
123 bigcrypt
124 When a user changes their password next, encrypt it with the DEC C2
125 algorithm.
126
127 sha256
128 When a user changes their password next, encrypt it with the SHA256
129 algorithm. The SHA256 algorithm must be supported by the crypt(3)
130 function.
131
132 sha512
133 When a user changes their password next, encrypt it with the SHA512
134 algorithm. The SHA512 algorithm must be supported by the crypt(3)
135 function.
136
137 blowfish
138 When a user changes their password next, encrypt it with the
139 blowfish algorithm. The blowfish algorithm must be supported by the
140 crypt(3) function.
141
142 gost_yescrypt
143 When a user changes their password next, encrypt it with the
144 gost-yescrypt algorithm. The gost-yescrypt algorithm must be
145 supported by the crypt(3) function.
146
147 yescrypt
148 When a user changes their password next, encrypt it with the
149 yescrypt algorithm. The yescrypt algorithm must be supported by the
150 crypt(3) function.
151
152 rounds=n
153 Set the optional number of rounds of the SHA256, SHA512, blowfish,
154 gost-yescrypt, and yescrypt password hashing algorithms to n.
155
156 broken_shadow
157 Ignore errors reading shadow information for users in the account
158 management module.
159
160 minlen=n
161 Set a minimum password length of n characters. The max. for DES
162 crypt based passwords are 8 characters.
163
164 no_pass_expiry
165 When set ignore password expiration as defined by the shadow entry
166 of the user. The option has an effect only in case pam_unix was not
167 used for the authentication or it returned authentication failure
168 meaning that other authentication source or method succeeded. The
169 example can be public key authentication in sshd. The module will
170 return PAM_SUCCESS instead of eventual PAM_NEW_AUTHTOK_REQD or
171 PAM_AUTHTOK_EXPIRED.
172
173 Invalid arguments are logged with syslog(3).
174
176 All module types (account, auth, password and session) are provided.
177
179 PAM_IGNORE
180 Ignore this module.
181
183 An example usage for /etc/pam.d/login would be:
184
185 # Authenticate the user
186 auth required pam_unix.so
187 # Ensure users account and password are still active
188 account required pam_unix.so
189 # Change the user's password, but at first check the strength
190 # with pam_cracklib(8)
191 password required pam_cracklib.so retry=3 minlen=6 difok=3
192 password required pam_unix.so use_authtok nullok md5
193 session required pam_unix.so
194
195
196
198 login.defs(5), pam.conf(5), pam.d(5), pam(8)
199
201 pam_unix was written by various people.
202
203
204
205Linux-PAM Manual 12/20/2018 PAM_UNIX(8)