PWQCHECK(1)

πŸ’– PWQCHECK πŸ’–

okay so bestie, let me put you on to something. pwqcheck is the little icon that checks your passphrase quality β€” and no, it's not vibing off its own opinions, it's running on the libpasswdqc library. it's giving "security bestie who actually knows ball." 🫢


✨ SYNOPSIS ✨

pwqcheck [options]

🌸 DESCRIPTION 🌸

the way pwqcheck works is so simple it's actually iconic. by default it expects to read 3 lines from standard input:

  • first line is a new password,
  • second line is an old password, and
  • third line is either an existing account name or a passwd(5) entry.

there are a number of supported options, which can be used to control the pwqcheck behavior. (we'll get to all of them, don't worry, every single one πŸŽ€)

on success, pwqcheck prints OK. and if you're writing a script that invokes pwqcheck, the suggestion is that you check for both a zero exit status and the OK line. yes bestie, both. iykyk. πŸ’…


πŸ‘‘ OPTIONS πŸ‘‘

  • min=N0,N1,N2,N3,N4 β€” (default: min=disabled,24,11,8,8) the minimum allowed password lengths for different kinds of passwords/passphrases. you can use the keyword disabled to disallow passwords of a given kind regardless of their length. and heads up: each subsequent number is required to be no larger than the preceding one.
    • 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's also a special class for non-ASCII characters, which could not be classified, but are assumed to be non-digits. πŸ’€
    • N1 is used for passwords consisting of characters from two character classes that do not meet the requirements for a passphrase.
    • 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 passphrase option below). πŸ‘€
    • N3 and N4 are used for passwords consisting of characters from three and four character classes, respectively.

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.

and 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. so like, length alone is not the moment. πŸŽ€

  • max=N β€” (default: max=72) 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 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.
okay this part is important, listen up: it is important that you do set max=8 if you are using the traditional hashes, or some weak passwords will pass the checks. not me letting weak passwords through, couldn't be us. 😭
  • passphrase=N β€” (default: passphrase=3) the number of words required for a passphrase.
  • match=N β€” (default: match=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. bestie that's so fair of it actually. πŸ’…

the substring search is case-insensitive and is able to detect and remove a common substring spelled backwards. yes it said that. iconic behavior. πŸ¦‹

  • similar=permit|deny β€” (default: similar=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.
  • wordlist=FILE β€” deny passwords that are based on lines of the tiny external text FILE, which can reasonably include common passwords, dictionary words in a local language other than English, and longer English words.

passwdqc includes built-in lists of a few thousand common English words mostly of lengths from 3 to 6, a handful of common character sequences such as keyboard walks, and many common passwords of length 7 and above. any word list possibly specified with this option is used in addition to the lists of English words and character sequences, but replaces the list of common passwords.

substring matching and discounting will be used if the match setting above is non-zero. and please note that this isn't to be used with large wordlists for performance reasons β€” so like, don't do that. πŸ™ˆ

  • denylist=FILE β€” deny passwords or passphrases directly appearing in the tiny external text FILE. that file can reasonably be e.g. a list of common passwords if only a relaxed policy is desired and stricter checks are thus disabled (using their separate options). such policy would only be somewhat effective against online/remote attacks, but not against offline attacks on hashed passwords. lowkey a vibe check fail against offline attackers, be aware. πŸ’€
  • filter=FILE β€” deny passwords or passphrases directly appearing in a maybe huge binary filter FILE created with pwqfilter. this is very efficient, needing at most two random disk reads per query. a filter created from millions of leaked passwords can reasonably be used on top of passwdqc's other checks to further reduce the number of passing yet weak passwords without causing unreasonable inconvenience (as e.g. higher minimum lengths and character set requirements could). obsessed with the efficiency honestly. ⭐
  • config=FILE β€” load config FILE in the passwdqc.conf format. this file may define any options described in passwdqc.conf(5), but only the min, max, passphrase, match, and config options are honored by pwqcheck. so don't come in here expecting the rest of the options to hit. πŸŽ€
  • -1 β€” read just 1 line (new passphrase). this is needed to use pwqcheck as the passwordcheck program on OpenBSD β€” e.g., with ":passwordcheck=/usr/bin/pwqcheck -1:\" (without the quotes, but with the trailing backslash) in the "default" section in /etc/login.conf.
  • -2 β€” read just 2 lines (new and old passphrases).
  • --multi β€” check multiple passphrases (until EOF). this option may be used on its own or along with the -1 or -2 options. pwqcheck will read 1, 2, or 3 lines and will output one line per passphrase to check. the lines will start with either OK or a message explaining why the passphrase did not pass the checks, followed by a colon and a space, and finally followed by the passphrase. the explanatory message is guaranteed to not include a colon. with this option, the exit status of pwqcheck depends solely on whether there were any errors preventing the strength of passphrases from being fully checked or not. a primary use for this option is to test different policies and/or different versions of passwdqc on large passphrase lists. perfect for the girlies running experiments fr fr. πŸ”₯
  • --version β€” output pwqcheck program version and exit.
  • -h, --help β€” output pwqcheck help text and exit.

πŸ’€ EXIT STATUS πŸ’€

pwqcheck exits with non-zero status when it encounters an invalid config file, invalid option, invalid parameter value, invalid data in standard input, and in any case when it fails to check passphrase strength. basically if anything's off it's not gonna pretend everything's fine, it's honest. 🫢

and without the --multi option, pwqcheck also exits with non-zero status when it detects a weak passphrase. so like, weak password = not slaying = exit non-zero. periodt.


πŸŽ€ FILES πŸŽ€

  • /etc/passwdqc.conf β€” (not read unless this suggested file location is specified with the config=/etc/passwdqc.conf option). so it's not just gonna read it on its own, you have to actually ask. πŸ’…

🌈 SEE ALSO 🌈


πŸ’œ AUTHORS πŸ’œ

the pam_passwdqc module was written for Openwall GNU//Linux by Solar Designer. the pwqcheck program was originally written for ALT GNU//Linux by Dmitry V. Levin, indirectly reusing code from pam_passwdqc (via libpasswdqc). this manual page (derived from the pam_passwdqc documentation) was written for Openwall GNU/*/Linux by Dmitry V. Levin. shoutout to the devs honestly, we love a collaborative moment. πŸ‘‘


okay that's the whole page bestie, you now know pwqcheck better than most people know themselves. this was brought to you by the Openwall Project, dated November 23, 2025 β€” go check those passphrases, stay safe, and remember: OK on success. slay. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from