2
$Id: pam_cracklib.sgml,v 1.4 2002/09/15 20:44:05 hartmans Exp $
4
This file was written by Andrew G. Morgan <morgan@kernel.org>
5
long password amendments are from Philip W. Dalrymple III <pwd@mdtsoft.com>
8
<sect1>Cracklib pluggable password strength-checker
15
<tag><bf>Module Name:</bf></tag>
19
<tag><bf>Author:</bf></tag>
21
Cristian Gafton <gafton@redhat.com>
23
<tag><bf>Maintainer:</bf></tag>
27
<tag><bf>Management groups provided:</bf></tag>
31
<tag><bf>Cryptographically sensitive:</bf></tag>
33
<tag><bf>Security rating:</bf></tag>
35
<tag><bf>Clean code base:</bf></tag>
37
<tag><bf>System dependencies:</bf></tag>
39
Requires the system library <tt/libcrack/ and a system dictionary:
40
<tt>/var/cache/cracklib/cracklib_dict</tt>.
42
<tag><bf>Network aware:</bf></tag>
46
<sect2>Overview of module
49
This module can be plugged into the <tt/password/ stack of a given
50
application to provide some plug-in strength-checking for passwords.
53
This module works in the following manner: it first calls the
54
<em>Cracklib</em> routine to check the strength of the password; if
55
crack likes the password, the module does an additional set of
56
strength checks. These checks are:
59
<item> <bf/Palindrome/ -
61
Is the new password a palindrome of the old one?
63
<item> <bf/Case Change Only/ -
65
Is the new password the the old one with only a change of case?
69
Is the new password too much like the old one? This is primarily
70
controlled by one argument, <tt/difok/ which is a number of characters
71
that if different between the old and new are enough to accept the new
72
password, this defaults to 10 or 1/2 the size of the new password
75
To avoid the lockup associated with trying to change a long and
76
complicated password, <tt/difignore/ is available. This argument can
77
be used to specify the minimum length a new password needs to be
78
before the <tt/difok/ value is ignored. The default value for
84
Is the new password too small? This is controlled by 5 arguments
85
<tt/minlen/, <tt/dcredit/, <tt/ucredit/, <tt/lcredit/, and
86
<tt/ocredit/. See the section on the arguments for the details of how
87
these work and there defaults.
91
Is the new password a rotated version of the old password?
93
<item> <bf/Already used/ -
95
Was the password used in the past? Previously used passwords are to
96
be found in /etc/security/opasswd.
101
This module with no arguments will work well for standard unix
102
password encryption. With md5 encryption, passwords can be longer
103
than 8 characters and the default settings for this module can make it
104
hard for the user to choose a satisfactory new password. Notably, the
105
requirement that the new password contain no more than 1/2 of the
106
characters in the old password becomes a non-trivial constraint. For
107
example, an old password of the form "the quick brown fox jumped over
108
the lazy dogs" would be difficult to change... In addition, the
109
default action is to allow passwords as small as 5 characters in
110
length. For a md5 systems it can be a good idea to increase the
111
required minimum size of a password. One can then allow more credit
112
for different kinds of characters but accept that the new password may
113
share most of these characters with the old password.
115
<sect2>Password component
120
<tag><bf>Recognized arguments:</bf></tag>
122
<tt/debug/; <tt/type=XXX/; <tt/retry=N/; <tt/difok=N/; <tt/minlen=N/;
123
<tt/dcredit=N/; <tt/ucredit=N/; <tt/lcredit=N/; <tt/ocredit=N/;
126
<tag><bf>Description:</bf></tag>
128
The action of this module is to prompt the user for a password and
129
check its strength against a system dictionary and a set of rules for
130
identifying poor choices.
133
The default action is to prompt for a single password, check its
134
strength and then, if it is considered strong, prompt for the password
135
a second time (to verify that it was typed correctly on the first
136
occasion). All being well, the password is passed on to subsequent
137
modules to be installed as the new authentication token.
140
The default action may be modified in a number of ways using the
141
arguments recognized by the module:
146
this option makes the module write information to syslog(3) indicating
147
the behavior of the module (this option does <bf/not/ write password
148
information to the log file).
150
<item> <tt/type=XXX/ -
152
the default action is for the module to use the following prompts when
153
requesting passwords: ``New UNIX password: '' and ``Retype UNIX
154
password: ''. Using this option you can replace the word UNIX with
157
<item> <tt/retry=N/ -
159
the default number of times this module will request a new password
160
(for strength-checking) from the user is 1. Using this argument this
161
can be increased to <tt/N/.
163
<item> <tt/difok=N/ -
165
This argument will change the default of 10 for the number of
166
characters in the new password that must not be present in the old
167
password. In addition, if 1/2 of the characters in the new password
168
are different then the new password will be accepted anyway.
170
<item> <tt/minlen=N/ -
172
The minimum acceptable size for the new password (plus one if credits
173
are not disabled which is the default).
174
In addition to the number of characters in the new password, credit (of
175
+1 in length) is given for each different kind of character (<em>other,
176
upper, lower</em> and <em/digit/). The default for this parameter is
177
9 which is good for a old style UNIX password all of the same type of
178
character but may be too low to exploit the added security of a md5
179
system. Note that there is a pair of length limits in
180
<em>Cracklib</em> itself, a "way too short" limit of 4 which is hard
181
coded in and a defined limit (6) that will be checked without
182
reference to <tt>minlen</tt>. If you want to allow passwords as short
183
as 5 characters you should either not use this module or recompile
184
the crack library and then recompile this module.
186
<item> <tt/dcredit=N/ -
188
(N >= 0) This is the maximum credit for having digits in the new password. If
189
you have less than or <tt/N/ digits, each digit will count +1 towards
190
meeting the current <tt/minlen/ value. The default for <tt/dcredit/
191
is 1 which is the recommended value for <tt/minlen/ less than 10.
192
(N < 0) This is the minimum number of digits that must be met for a new
195
<item> <tt/ucredit=N/ -
197
(N >= 0) This is the maximum credit for having upper case letters in the new
198
password. If you have less than or <tt/N/ upper case letters each
199
letter will count +1 towards meeting the current <tt/minlen/ value.
200
The default for <tt/ucredit/ is 1 which is the recommended value for
201
<tt/minlen/ less than 10. (N < 0) This is the minimum number of upper
202
case letters that must be met for a new password.
204
<item> <tt/lcredit=N/ -
206
(N >= 0) This is the maximum credit for having lower case letters in the new
207
password. If you have less than or <tt/N/ lower case letters, each
208
letter will count +1 towards meeting the current <tt/minlen/ value.
209
The default for <tt/lcredit/ is 1 which is the recommended value for
210
<tt/minlen/ less than 10. (N < 0) This is the minimum number of lower
211
case letters that must be met for a new password.
213
<item> <tt/ocredit=N/ -
215
(N >= 0) This is the maximum credit for having other characters in the new
216
password. If you have less than or <tt/N/ other characters, each
217
character will count +1 towards meeting the current <tt/minlen/ value.
218
The default for <tt/ocredit/ is 1 which is the recommended value for
219
<tt/minlen/ less than 10. (N < 0) This is the minimum number of other
220
characters that must be met for a new password.
222
<item> <tt/use_authtok/ -
224
This argument is used to <em/force/ the module to not prompt the user
225
for a new password but use the one provided by the previously stacked
226
<tt/password/ module.
230
<tag><bf>Examples/suggested usage:</bf></tag>
233
For an example of the use of this module, we show how it may be
234
stacked with the password component of <tt/pam_unix/:
238
# These lines stack two password type modules. In this example the
239
# user is given 3 opportunities to enter a strong password. The
240
# "use_authtok" argument ensures that the pam_unix module does not
241
# prompt for a password, but instead uses the one provided by
244
passwd password required pam_cracklib.so retry=3
245
passwd password required pam_unix.so use_authtok
250
Another example (in the <tt>/etc/pam.d/passwd</tt> format) is for the
251
case that you want to use md5 password encryption:
256
# These lines allow a md5 systems to support passwords of at least 14
257
# bytes with extra credit of 2 for digits and 2 for others the new
258
# password must have at least three bytes that are not present in the
261
password required pam_cracklib.so \
262
difok=3 minlen=15 dcredit= 2 ocredit=2
263
password required pam_unix.so use_authtok nullok md5
268
And here is another example in case you don't want to use credits:
273
# These lines require the user to select a password with a minimum
274
# length of 8 and with at least 1 digit number, 1 upper case letter,
275
# and 1 other character
277
password required pam_cracklib.so \
278
dcredit=-1 ucredit=-1 ocredit=-1 lcredit=0 minlen=8
279
password required pam_pwdb.so use_authtok nullok md5
284
In this example we simply say that the password must have a minimum
290
# These lines require the user to select a password with a mimimum
291
# length of 8. He gets no credits and he is not forced to use
292
# digit numbers, upper case letters etc.
294
password required pam_cracklib.so \
295
dcredit=0 ucredit=0 ocredit=0 lcredit=0 minlen=8
296
password required pam_pwdb.so use_authtok nullok md5
303
End of sgml insert for this module.