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