1PAM_PASSWDQC(8)           BSD System Manager's Manual          PAM_PASSWDQC(8)
2

NAME

4     pam_passwdqc — Password quality-control PAM module
5

SYNOPSIS

7     [service-name] module-type control-flag pam_passwdqc [options]
8

DESCRIPTION

10     The pam_passwdqc module is a simple password strength checking module for
11     PAM.  In addition to checking regular passwords, it offers support for
12     passphrases and can provide randomly generated ones.
13
14     The pam_passwdqc module provides functionality for only one PAM manage‐
15     ment group: password changing.  In terms of the module-type parameter,
16     this is the “password” feature.
17
18     The pam_chauthtok() service function may ask the user for a new password,
19     and verify that it meets certain minimum standards.  If the chosen pass‐
20     word is unsatisfactory, the service function returns PAM_AUTHTOK_ERR.
21
22     The following options may be passed to the module:
23
24     min=N0,N1,N2,N3,N4
25             (min=disabled,24,11,8,7) The minimum allowed password lengths for
26             different kinds of passwords/passphrases.  The keyword disabled
27             can be used to disallow passwords of a given kind regardless of
28             their length.  Each subsequent number is required to be no larger
29             than the preceding one.
30
31             N0 is used for passwords consisting of characters from one char‐
32             acter class only.  The character classes are: digits, lower-case
33             letters, upper-case letters, and other characters.  There is also
34             a special class for non-ASCII characters, which could not be
35             classified, but are assumed to be non-digits.
36
37             N1 is used for passwords consisting of characters from two char‐
38             acter classes that do not meet the requirements for a passphrase.
39
40             N2 is used for passphrases.  Note that besides meeting this
41             length requirement, a passphrase must also consist of a suffi‐
42             cient number of words (see the passphrase option below).
43
44             N3 and N4 are used for passwords consisting of characters from
45             three and four character classes, respectively.
46
47             When calculating the number of character classes, upper-case let‐
48             ters used as the first character and digits used as the last
49             character of a password are not counted.
50
51             In addition to being sufficiently long, passwords are required to
52             contain enough different characters for the character classes and
53             the minimum length they have been checked against.
54
55             Required password complexity is proportional to its length.
56             Passwords must have at least N4 characters. Passwords shorter
57             than N3 characters need to have lower case letters, upper case
58             letters, digits and symbols. Passwords shorter than N2 characters
59             must have 3 or more classes of characters.  Passwords shorter
60             than N1 characters must have 2 or more classes of characters.
61             Passwords longer than N1 characters can have just one type of
62             characters in them.
63
64             In other words, the number of required unique characters depends
65             how long or complex the password is.
66
67     max=N   (max=40) The maximum allowed password length.  This can be used
68             to prevent users from setting passwords that may be too long for
69             some system services.  The value 8 is treated specially: if max
70             is set to 8, passwords longer than 8 characters will not be
71             rejected, but will be truncated to 8 characters for the strength
72             checks and the user will be warned.  This is to be used with the
73             traditional DES-based password hashes, which truncate the pass‐
74             word at 8 characters.
75
76             It is important that you do set max=8 if you are using the tradi‐
77             tional hashes, or some weak passwords will pass the checks.
78
79     passphrase=N
80             (passphrase=3) The number of words required for a passphrase, or
81             0 to disable the support for user-chosen passphrases.
82
83     match=N
84             (match=4) The length of common substring required to conclude
85             that a password is at least partially based on information found
86             in a character string, or 0 to disable the substring search.
87             Note that the password will not be rejected once a weak substring
88             is found; it will instead be subjected to the usual strength
89             requirements with the weak substring removed.
90
91             The substring search is case-insensitive and is able to detect
92             and remove a common substring spelled backwards.
93
94     similar=permit|deny
95             (similar=deny) Whether a new password is allowed to be similar to
96             the old one.  The passwords are considered to be similar when
97             there is a sufficiently long common substring and the new pass‐
98             word with the substring removed would be weak.
99
100     random=N[,only]
101             (random=42) The size of randomly-generated passphrases in bits
102             (24 to 72), or 0 to disable this feature.  Any passphrase that
103             contains the offered randomly-generated string will be allowed
104             regardless of other possible restrictions.
105
106             The only modifier can be used to disallow user-chosen passwords.
107
108     enforce=none|users|everyone
109             (enforce=everyone) The module can be configured to warn of weak
110             passwords only, but not actually enforce strong passwords.  The
111             users setting will enforce strong passwords for invocations by
112             non-root users only.
113
114     non-unix
115             Normally, pam_passwdqc uses getpwnam(3) to obtain the user's per‐
116             sonal login information and use that during the password strength
117             checks.  This behavior can be disabled with the non-unix option.
118
119     retry=N
120             (retry=3) The number of times the module will ask for a new pass‐
121             word if the user fails to provide a sufficiently strong password
122             and enter it twice the first time.
123
124     ask_oldauthtok[=update]
125             Ask for the old password as well.  Normally, pam_passwdqc leaves
126             this task for subsequent modules.  With no argument, the
127             ask_oldauthtok option will cause pam_passwdqc to ask for the old
128             password during the preliminary check phase.  If the
129             ask_oldauthtok option is specified with the update argument,
130             pam_passwdqc will do that during the update phase.
131
132     check_oldauthtok
133             This tells pam_passwdqc to validate the old password before giv‐
134             ing a new password prompt.  Normally, this task is left for sub‐
135             sequent modules.
136
137             The primary use for this option is when ask_oldauthtok=update is
138             also specified, in which case no other module gets a chance to
139             ask for and validate the password.  Of course, this will only
140             work with UNIX passwords.
141
142     disable_firstupper_lastdigit_check
143             This tells pam_passwdqc to include upper-case letters used as the
144             first character and digits used as the last character of a pass‐
145             word when calculating the number of character classes.
146
147     use_first_pass, use_authtok
148             Use the new password obtained by modules stacked before
149             pam_passwdqc.  This disables user interaction within
150             pam_passwdqc.  The only difference between use_first_pass and
151             use_authtok is that the former is incompatible with
152             ask_oldauthtok.
153
154     oldpass_prompt_file, newpass_prompt_file = absolute-file-path
155             These can be used to override prompts while requesting old pass‐
156             word and new password, respectively.  The maximum size of the
157             prompt files can be 4096 characters at present.  If the file size
158             is more than 4096 characters, the output will be truncated to
159             4096 characters.
160

SEE ALSO

162     getpwnam(3), pam.conf(5), pam(8)
163

AUTHORS

165     The pam_passwdqc module was written for Openwall GNU/*/Linux by Solar
166     Designer <solar at openwall.com>.  This manual page, derived from the
167     author's documentation, was written for the FreeBSD Project by ThinkSec
168     AS and NAI Labs, the Security Research Division of Network Associates,
169     Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (“CBOSS”), as part of
170     the DARPA CHATS research program.
171
172BSD                            February 12, 2008                           BSD
Impressum