.\" Copyright (c) 2000-2003,2005,2008 Solar Designer
.\" All rights reserved.
.\" Copyright (c) 2001 Networks Associates Technology, Inc.
.\" All rights reserved.
.\" Copyright (c) 2009 Dmitry V. Levin
.\" All rights reserved.
.\"
.\" Portions of this software were developed for the FreeBSD Project by
.\" ThinkSec AS and NAI Labs, the Security Research Division of Network
.\" Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
.\" ("CBOSS"), as part of the DARPA CHATS research program.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD: src/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8,v 1.4 2002/05/30 14:49:57 ru Exp $
.\" $Owl: Owl/packages/passwdqc/passwdqc/passwdqc.conf.5,v 1.11 2013/04/23 14:14:07 solar Exp $
.\"
.Dd March 13, 2010
.Dt PASSWDQC.CONF 5
.Os "Openwall Project"
.Sh NAME
.Nm passwdqc.conf
.Nd libpasswdqc configuration file
.Sh DESCRIPTION
libpasswdqc is a simple password strength checking library.
In addition to checking regular passwords, it offers support for
passphrases and can provide randomly generated ones.
A
.Nm
configuration file may be used to override default libpasswdqc settings.
.Sh FORMAT
A
.Nm
file consists of 0 or more lines of the following format:
.Dl Ar option Ns = Ns Ar value
.Pp
Empty lines and lines beginning with
.Dq Li #
are ignored.
Whitespace characters between the
.Ar option ,
.Dq Li = ,
and
.Ar value
are not allowed.
.Sh DIRECTIVE OPTIONS
.Bl -tag -width indent
.It Cm config Ns = Ns Ar FILE
Load the specified configuration
.Ar FILE
in the
.Cm passwdqc.conf
format.
This file may define any options described in this manual,
including load of yet another configuration file, but loops are not allowed.
.El
.Sh PASSWORD QUALITY CONTROL OPTIONS
.Bl -tag -width Ds
.Sm off
.It Xo
.Cm min No =
.Ar N0 , N1 , N2 , N3 , N4
.Xc
.Sm on
.Pq default: min=disabled,24,11,8,7
The minimum allowed password lengths for different kinds of
passwords/passphrases.
The keyword
.Cm disabled
can be used to
disallow passwords of a given kind regardless of their length.
Each subsequent number is required to be no larger than the preceding
one.
.Pp
.Ar N0
is used for passwords consisting of characters from one character
class only.
The character classes are: digits, lower-case letters, upper-case
letters, and other characters.
There is also a special class for
.No non- Ns Tn ASCII
characters, which could not be classified, but are assumed to be non-digits.
.Pp
.Ar N1
is used for passwords consisting of characters from two character
classes that do not meet the requirements for a passphrase.
.Pp
.Ar N2
is used for passphrases.
Note that besides meeting this length requirement,
a passphrase must also consist of a sufficient number of words (see the
.Cm passphrase
option below).
.Pp
.Ar N3
and
.Ar N4
are used for passwords consisting of characters from three
and four character classes, respectively.
.Pp
When calculating the number of character classes, upper-case letters
used as the first character and digits used as the last character of a
password are not counted.
.Pp
In addition to being sufficiently long, passwords are required to
contain enough different characters for the character classes and
the minimum length they have been checked against.
.Pp
.It Cm max Ns = Ns Ar N
.Pq default: Cm max Ns = Ns 40
The maximum allowed password length.
This can be used to prevent users from setting passwords that may be
too long for some system services.
The value 8 is treated specially: if
.Cm max
is set to 8, passwords longer than 8 characters will not be rejected,
but will be truncated to 8 characters for the strength checks and the
user will be warned.
This is to be used with the traditional DES-based password hashes,
which truncate the password at 8 characters.
.Pp
It is important that you do set
.Cm max Ns = Ns 8
if you are using the traditional
hashes, or some weak passwords will pass the checks.
.It Cm passphrase Ns = Ns Ar N
.Pq default: Cm passphrase Ns = Ns 3
The number of words required for a passphrase, or 0 to disable the
support for user-chosen passphrases.
.It Cm match Ns = Ns Ar N
.Pq default: Cm match Ns = Ns 4
The length of common substring required to conclude that a password is
at least partially based on information found in a character string,
or 0 to disable the substring search.
Note that the password will not be rejected once a weak substring is
found; it will instead be subjected to the usual strength requirements
with the weak substring partially discounted.
.Pp
The substring search is case-insensitive and is able to detect and
remove a common substring spelled backwards.
.It Xo
.Sm off
.Cm similar No = Cm permit | deny
.Sm on
.Xc
.Pq default: Cm similar Ns = Ns Cm deny
Whether a new password is allowed to be similar to the old one.
The passwords are considered to be similar when there is a sufficiently
long common substring and the new password with the substring partially
discounted would be weak.
.It Xo
.Sm off
.Cm random No = Ar N
.Op , Cm only
.Sm on
.Xc
.Pq default: Cm random Ns = Ns 47
The size of randomly-generated passphrases in bits (24 to 85),
or 0 to disable this feature.
Any passphrase that contains the offered randomly-generated string will be
allowed regardless of other possible restrictions.
.Pp
The
.Cm only
modifier can be used to disallow user-chosen passwords.
.El
.Sh PAM MODULE OPTIONS
.Bl -tag -width indent
.It Xo
.Sm off
.Cm enforce No = Cm none | users | everyone
.Sm on
.Xc
.Pq default: Cm enforce Ns = Ns Cm everyone
The PAM module can be configured to warn of weak passwords only, but not
actually enforce strong passwords.
The
.Cm users
setting will enforce strong passwords for invocations by non-root users only.
.It Cm non-unix
Normally, the PAM module uses
.Xr getpwnam 3
to obtain the user's personal login information and use that during
the password strength checks.
This behavior can be disabled with the
.Cm non-unix
option.
.It Cm retry Ns = Ns Ar N
.Pq default: Cm retry Ns = Ns 3
The number of times the PAM module will ask for a new password if the
user fails to provide a sufficiently strong password and enter it twice
the first time.
.It Cm ask_oldauthtok Ns Op = Ns Cm update
Ask for the old password as well.
Normally, the PAM module leaves this task for subsequent modules.
With no argument, the
.Cm ask_oldauthtok
option will cause the PAM module to ask for the old password during the
preliminary check phase. If the
.Cm ask_oldauthtok
option is specified with the
.Cm update
argument, the PAM module will do that during the update phase.
.It Cm check_oldauthtok
This tells the PAM module to validate the old password before giving a
new password prompt.
Normally, this task is left for subsequent modules.
.Pp
The primary use for this option is when
.Cm ask_oldauthtok Ns = Ns Cm update
is also specified, in which case no other module gets a chance to ask
for and validate the password.
Of course, this will only work with
.Ux
passwords.
.It Cm use_first_pass , use_authtok
Use the new password obtained by other modules stacked before the PAM
module. This disables user interaction within the PAM module.
The only difference between
.Cm use_first_pass
and
.Cm use_authtok
is that the former is incompatible with
.Cm ask_oldauthtok .
.El
.Sh FILES
.Pa /etc/passwdqc.conf .
.Sh SEE ALSO
.Xr getpwnam 3 ,
.Xr pam_passwdqc 8 .
.Pp
http://www.openwall.com/passwdqc/
.Sh AUTHORS
The pam_passwdqc module was written for Openwall GNU/*/Linux by
.An Solar Designer Aq solar at openwall.com .
This manual page was derived from
.Xr pam_passwdqc 8 . The latter, derived from the author's
documentation, was written for the
.Fx
Project by
ThinkSec AS and NAI Labs, the Security Research Division of Network
Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.