PWQUALITY.CONF(5)
๐ PWQUALITY.CONF(5) ๐
okay bestie, welcome to the File Formats Manual section of the universe, where we talk about pwquality.conf โ literally the glow-up manual for your system's password rules. pull up a chair, grab a strawberry ๐, and let's get into it.
โจ NAME โจ
pwquality.conf โ the configuration file for the libpwquality library. it's giving "boss of all the password rules" energy. ๐
๐ธ SYNOPSIS ๐ธ
/etc/security/pwquality.conf
/etc/security/pwquality.conf.d/*.conf
two paths, both iconic, both doing their own little thing. ๐
๐ฆ DESCRIPTION ๐ฆ
so pwquality.conf is how you configure the default password quality requirements for the system passwords. the libpwquality library reads this file, and so do all the utilities that use that library for checking and generating passwords. no cap, this is the source of truth. ๐ฅ
the file format is very simple: it's name = value, with comments allowed and starting with the # character. whitespace at the beginning of the line, at the end of the line, and around the = sign is all ignored. we don't care. it's not that deep. โจ
also, before you even get to the main file, the libpwquality library first reads all the *.conf files from the /etc/security/pwquality.conf.d directory, in ASCII sorted order. and if the same setting shows up more than once, the values get overridden in the order the files are parsed. last one to speak wins, fr fr. ๐
๐ OPTIONS ๐
here are all the possible options you can put in the file, bestie. every single one. don't skip any. ๐
difokโ the number of characters in the new password that must not be present in the old password. (default1)
the special value of 0 disables all the checks of similarity between the new password and the old password โ except for the new password being exactly the same as the old one, because that one still gets caught. ๐
minlenโ the minimum acceptable size for the new password (plus one if credits are not disabled, which is the default). (Seepam_pwquality(8).) cannot be set to a value lower than6. (default8)dcreditโ the maximum credit for having digits in the new password. if it's less than0, then it's the minimum number of digits in the new password. (default0)ucreditโ the maximum credit for having uppercase characters in the new password. if it's less than0, then it's the minimum number of uppercase characters in the new password. (default0)lcreditโ the maximum credit for having lowercase characters in the new password. if it's less than0, then it's the minimum number of lowercase characters in the new password. (default0)ocreditโ the maximum credit for having other characters in the new password. if it's less than0, then it's the minimum number of other characters in the new password. (default0)minclassโ the minimum number of required classes of characters for the new password (digits, uppercase, lowercase, others). (default0)maxrepeatโ the maximum number of allowed same consecutive characters in the new password. the check is disabled if the value is0. (default0)maxsequenceโ the maximum length of monotonic character sequences in the new password. examples of such a sequence are'12345'or'fedcb'. note that most such passwords will not pass the simplicity check unless the sequence is only a minor part of the password. the check is disabled if the value is0. (default0)maxclassrepeatโ the maximum number of allowed consecutive characters of the same class in the new password. the check is disabled if the value is0. (default0)gecoscheckโ if nonzero, check whether the words longer than 3 characters from the GECOS field of the user'spasswd(5)entry are contained in the new password. the check is disabled if the value is0. (default0)dictcheckโ if nonzero, check whether the password (with possible modifications) matches a word in a dictionary. currently the dictionary check is performed using the cracklib library. (default1)usercheck=Nโ if nonzero, check whether the password (with possible modifications) contains the user name in some form. it is not performed for user names shorter than 3 characters. (default1)usersubstr=Nโ if greater than3(because of the minimum length inusercheck), check whether the password contains a substring of at least N length in some form. (default0)enforcing=Nโ if nonzero, reject the password if it fails the checks; otherwise just print the warning. this setting applies only to thepam_pwqualitymodule and possibly other applications that explicitly change their behavior based on it. it does not affectpwmake(1)andpwscore(1). (default1)badwordsโ a space separated list of words that must not be contained in the password. these are additional words on top of the cracklib dictionary check. this setting can also be used by applications to emulate the gecos check for user accounts that are not created yet. ๐ซถdictpathโ the path to the cracklib dictionaries. the default is to use the cracklib default. ๐retry=Nโ prompt the user at most N times before returning with an error. the default is1.enforce_for_rootโ the module will return an error on a failed check even if the user changing the password is root. this option is off by default, which means that only the message about the failed check is printed, but root can change the password anyway. note that root is not asked for an old password, so the checks that compare the old and new password are not performed. ๐local_users_onlyโ the module will not test the password quality for users that are not present in the/etc/passwdfile. the module still asks for the password so the following modules in the stack can use theuse_authtokoption. this option is off by default.
not me listing all twenty of these for you. yes bestie, all of them. every flag. periodt. ๐
๐ SEE ALSO ๐
pwscore(1), pwmake(1), pam_pwquality(8)
go read those too, iykyk. ๐ง
๐ AUTHORS ๐
Tomas Mraz <tmraz@redhat.com>
and that's the whole vibe check, bestie. this page came to you courtesy of Red Hat, Inc., dated 2020-08-03, and it's the pwquality.conf(5) manual โ iconic, timeless, and honestly? it ate. โจ๐๐ no cap, now go set some good password rules. slay. ๐ฆ๐ธ
๐ฆ where this page comes from
- alpine 3.24: libpwquality-doc 1.4.5-r6 ยท BSD-3-Clause
- centos-stream 9: libpwquality 1.4.4-8.el9 ยท BSD or GPLv2+
- centos-stream 9: libpwquality 1.4.4-8.el9 ยท BSD or GPLv2+
- debian bookworm: libpwquality-common 1.4.5-1 ยท libpwquality OR GPL-2.0-or-later
- debian trixie: libpwquality-common 1.4.5-5 ยท libpwquality OR GPL-2.0-or-later
- fedora 43: libpwquality 1.4.5-14.fc43 ยท BSD-3-Clause OR GPL-2.0-or-later
- fedora 43: libpwquality 1.4.5-14.fc43 ยท BSD-3-Clause OR GPL-2.0-or-later
- fedora 44: libpwquality 1.4.5-15.fc44 ยท BSD-3-Clause OR GPL-2.0-or-later
- fedora 44: libpwquality 1.4.5-15.fc44 ยท BSD-3-Clause OR GPL-2.0-or-later
- opensuse-leap 16.0: libpwquality1 1.4.5-160000.3.2 ยท BSD-3-Clause OR GPL-2.0-or-later
- opensuse-leap 16.0: libpwquality1 1.4.5-160000.3.2 ยท BSD-3-Clause OR GPL-2.0-or-later
- opensuse-leap 16.0: libpwquality1 1.4.5-160000.3.2 ยท BSD-3-Clause OR GPL-2.0-or-later
- opensuse-leap 16.0: libpwquality1 1.4.5-160000.3.2 ยท BSD-3-Clause OR GPL-2.0-or-later
- ubuntu jammy: libpwquality-common 1.4.4-1build2 ยท libpwquality OR GPL-2.0-or-later
- ubuntu noble: libpwquality-common 1.4.5-3build1 ยท libpwquality OR GPL-2.0-or-later
- ubuntu questing: libpwquality-common 1.4.5-5
- ubuntu resolute: libpwquality-common 1.4.5-5build1 ยท libpwquality OR GPL-2.0-or-later
- ubuntu stonking: libpwquality-common 1.4.5-5build1 ยท libpwquality OR GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms