Merge branch 'master' of git://crater.dragonflybsd.org/dragonfly
[dragonfly.git] / contrib / pam_passwdqc / README
1 pam_passwdqc is a simple password strength checking module for
2 PAM-aware password changing programs, such as passwd(1).  In addition
3 to checking regular passwords, it offers support for passphrases and
4 can provide randomly generated ones.  All features are optional and
5 can be (re-)configured without rebuilding.
6
7 This module should be stacked before your usual password changing
8 module (such as pam_unix or pam_pwdb) in the password management group
9 (the "password" lines in /etc/pam.d/passwd or /etc/pam.conf).  The
10 password changing module should then be told to use the provided new
11 authentication token (new password) rather than request it from the
12 user.  There's usually the "use_authtok" option to do that.  If your
13 password changing module lacks the "use_authtok" option or its prompts
14 are inconsistent with pam_passwdqc's, you may tell pam_passwdqc to ask
15 for the old password as well, with "ask_oldauthtok".  In that case the
16 option to use with the password changing module is "use_first_pass".
17
18 There's a number of supported options which can be used to modify the
19 behavior of pam_passwdqc (defaults are given in square brackets):
20
21         min=N0,N1,N2,N3,N4              [min=disabled,24,11,8,7]
22
23 The minimum allowed password lengths for different kinds of passwords
24 and passphrases.  The keyword "disabled" can be used to disallow
25 passwords of a given kind regardless of their length.  Each subsequent
26 number is required to be no larger than the preceding one.
27
28 N0 is used for passwords consisting of characters from one character
29 class only.  The character classes are: digits, lower-case letters,
30 upper-case letters, and other characters.  There is also a special
31 class for non-ASCII characters, which could not be classified, but are
32 assumed to be non-digits.
33
34 N1 is used for passwords consisting of characters from two character
35 classes that do not meet the requirements for a passphrase.
36
37 N2 is used for passphrases.  Note that besides meeting this length
38 requirement, a passphrase must also consist of a sufficient number of
39 words (see the "passphrase" option below).
40
41 N3 and N4 are used for passwords consisting of characters from three
42 and four character classes, respectively.
43
44 When calculating the number of character classes, upper-case letters
45 used as the first character and digits used as the last character of a
46 password are not counted.
47
48 In addition to being sufficiently long, passwords are required to
49 contain enough different characters for the character classes and
50 the minimum length they have been checked against.
51
52         max=N                           [max=40]
53
54 The maximum allowed password length.  This can be used to prevent
55 users from setting passwords that may be too long for some system
56 services.
57
58 The value 8 is treated specially: with max=8, passwords longer than 8
59 characters will not be rejected, but will be truncated to 8 characters
60 for the strength checks and the user will be warned.  This is to be
61 used with the traditional DES-based password hashes, which truncate
62 the password at 8 characters.
63
64 It is important that you do set max=8 if you are using the traditional
65 hashes, or some weak passwords will pass the checks.
66
67         passphrase=N                    [passphrase=3]
68
69 The number of words required for a passphrase, or 0 to disable the
70 support for user-chosen passphrases.
71
72         match=N                         [match=4]
73
74 The length of common substring required to conclude that a password is
75 at least partially based on information found in a character string,
76 or 0 to disable the substring search.  Note that the password will not
77 be rejected once a weak substring is found; it will instead be
78 subjected to the usual strength requirements with the weak substring
79 removed.
80
81 The substring search is case-insensitive and is able to detect and
82 remove a common substring spelled backwards.
83
84         similar=permit|deny             [similar=deny]
85
86 Whether a new password is allowed to be similar to the old one.  The
87 passwords are considered to be similar when there is a sufficiently
88 long common substring and the new password with the substring removed
89 would be weak.
90
91         random=N[,only]                 [random=42]
92
93 The size of randomly-generated passphrases in bits (24 to 72), or 0 to
94 disable this feature.  Any passphrase that contains the offered
95 randomly-generated string will be allowed regardless of other possible
96 restrictions.
97
98 The "only" modifier can be used to disallow user-chosen passwords.
99
100         enforce=none|users|everyone     [enforce=everyone]
101
102 The module can be configured to warn of weak passwords only, but not
103 actually enforce strong passwords.  The "users" setting will enforce
104 strong passwords for invocations by non-root users only.
105
106         non-unix                        []
107
108 Normally, the module uses getpwnam(3) to obtain the user's personal
109 login information and use that during the password strength checks.
110 This behavior can be disabled with the "non-unix" option.
111
112         retry=N                         [retry=3]
113
114 The number of times the module will ask for a new password if the user
115 fails to provide a sufficiently strong password and enter it twice the
116 first time.
117
118         ask_oldauthtok[=update]         []
119
120 Ask for the old password as well.  Normally, pam_passwdqc leaves this
121 task for subsequent modules.  With no argument, the "ask_oldauthtok"
122 option will cause pam_passwdqc to ask for the old password during the
123 preliminary check phase.  With "ask_oldauthtok=update", pam_passwdqc
124 will do that during the update phase.
125
126         check_oldauthtok                []
127
128 This tells pam_passwdqc to validate the old password before giving a
129 new password prompt.  Normally, this task is left for subsequent
130 modules.
131
132 The primary use for this option is when "ask_oldauthtok=update" is
133 also specified, in which case no other module gets a chance to ask
134 for and validate the password.  Of course, this will only work with
135 Unix passwords.
136
137         use_first_pass                  []
138         use_authtok                     []
139
140 Use the new password obtained by modules stacked before pam_passwdqc.
141 This disables user interaction within pam_passwdqc.  With this module,
142 the only difference between "use_first_pass" and "use_authtok" is that
143 the former is incompatible with "ask_oldauthtok".
144
145 -- 
146 Solar Designer <solar at openwall.com>
147
148 $Owl: Owl/packages/pam_passwdqc/pam_passwdqc/README,v 1.11 2008/02/12 19:43:33 solar Exp $