KRB5-STRENGTH(5)
π KRB5-STRENGTH π
okay so this is the manual page for krb5-strength(5) and bestie, it's a whole thing. sit down, grab a strawberry π, we're doing this.
β¨ NAME β¨
krb5-strength β a Kerberos password strength checking plugin. that's it. that's the whole vibe. π
π SYNOPSIS π
okay so depending on which Kerberos you're running, the config looks a lil different. MIT Kerberos first:
[plugins]
pwqual = {
module = strength:/usr/lib/x86_64-linux-gnu/krb5/plugins/pwqual/strength.so
}
and now Heimdal:
[password_quality]
policies = krb5-strength
policy_libraries = /usr/lib/x86_64-linux-gnu/krb5/plugins/pwqual/strength.so
that's the whole synopsis, no cap. β¨
π¦ DESCRIPTION π¦
so strength.so is a KDC plugin that does Kerberos password strength checking, and it works with either MIT Kerberos or Heimdal, and it ships as part of the krb5-strength package. π«Ά
for MIT Kerberos KDCs (or, more to the point, kadmind servers), this plugin is the recommended way of enabling strength checking. periodt.
for Heimdal KDCs, you normally should use the heimdal-strength external program instead β but the plugin is a supported option if you want to avoid external programs for some reason. so like, valid, but not the default bestie move.
for this module to be effective for either Heimdal or MIT Kerberos, you will also need to construct a dictionary. what type of dictionary you create depends on what backends you want to use: CrackLib, CDB, or SQLite.
CrackLib, the how-to: on Debian systems, you can install the cracklib-runtime package and use the cracklib-format and cracklib-packer utilities that come with it. cracklib-format takes a set of wordlists and outputs a wordlist in the format required by cracklib-packer, and cracklib-packer turns this into a CrackLib dictionary. alternately, you can use the mkdict and packer utilities, which are included in the krb5-strength package but not installed by default π. you can run them out of the cracklib directory of the source tree after building. (mkdict is the equivalent of cracklib-format.) iconic honestly.
CDB or SQLite? for building a CDB or SQLite dictionary, use krb5-strength-wordlist. slay.
π CONFIGURATION π
first things first: build and install either a CrackLib dictionary as described above. the CrackLib dictionary will consist of three files, one each ending in *.hwm, *.pwd, and *.pwi. meanwhile the CDB and SQLite dictionaries will be single files, conventionally ending in *.cdb and *.sqlite respectively. install those files somewhere on your system. then, follow the relevant instructions below for either Heimdal or MIT Kerberos.
also, go read "Other Settings" below for additional krb5.conf setting supported by both Heimdal and MIT Kerberos. don't skip it, i see you π
πΈ Heimdal πΈ
there are two options here: using an external password check program, or using the plugin. i recommend the external password check program unless you encounter speed problems with that approach that cause kpasswd to time out. if you choose to use the external program, read the heimdal-strength documentation instead of this documentation. bye bestie π
if using the module, first add a stanza like the following to the [appdefaults] section of your /etc/krb5.conf (or wherever your krb5.conf file is located):
krb5-strength = {
password_dictionary = /path/to/cracklib/dictionary
password_dictionary_cdb = /path/to/cdb/dictionary.cdb
password_dictionary_sqlite = /path/to/sqlite/dictionary.sqlite
}
the first setting configures a CrackLib dictionary, the second a CDB dictionary, and the third a SQLite dictionary. the provided path should be the full path to the dictionary files, omitting the trailing *.hwm, *.pwd, and *.pwi extensions for the CrackLib dictionary (but including the extensions for the other types). you can use any combination of the three settings. if you use more than one, CrackLib will be checked first, then CDB, and then SQLite as appropriate. it's giving β¨priority queueβ¨.
when checking against a CDB database, the password, the password with the first character removed, the last character removed, the first and last characters removed, the first two characters removed, and the last two characters removed will all be checked against the dictionary. yeah, six whole checks, she's thorough π
when checking a SQLite database, the password will be rejected if it is within edit distance one of any word in the dictionary, meaning that the database word can be formed from the password by deleting, adding, or changing a single character. so close but so wrong, love that for you π
then, add a new section (or modify the existing [password_quality] section) like the following:
[password_quality]
policies = krb5-strength
policy_libraries = /usr/lib/x86_64-linux-gnu/krb5/plugins/pwqual/strength.so
in either krb5.conf or kdc.conf. note that some older versions of Heimdal have a bug in the support for loading modules when policy_libraries is set. if you get an error like:
didn't find `kadm5_password_verifier' symbol in `(null)'
you may have to omit policy_libraries in your configuration and instead pass the --check-library argument to kpasswdd specifying the library to load. yeah, it's giving cursed, but we move. π
if you want to also enable history checking, see heimdal-history(1) for further instructions. π§
π MIT Kerberos π
to add this module to the list of password quality checks, add a section to krb5.conf (or to a separate kdc.conf if you use that) like:
[plugins]
pwqual = {
module = strength:/usr/lib/x86_64-linux-gnu/krb5/plugins/pwqual/strength.so
}
to register the plugin. boom, registered. β¨
there are two ways to tell where the dictionary is. pick your fighter:
option one: use krb5.conf (and in this case you must use krb5.conf, even if you use a separate kdc.conf file β no substitutions, bestie). for this approach, add the following to the [appdefaults] section:
krb5-strength = {
password_dictionary = /path/to/cracklib/dictionary
password_dictionary_cdb = /path/to/cdb/dictionary.cdb
password_dictionary_sqlite = /path/to/sqlite/dictionary.sqlite
}
the first setting configures a CrackLib dictionary, the second a CDB dictionary, and the third a SQLite dictionary. the provided path should be the full path to the dictionary files, omitting the trailing *.hwm, *.pwd, and *.pwi extensions for the CrackLib dictionary (but including the extensions for the other types). you can use any combination of the three settings. if you use more than one, CrackLib will be checked first, then CDB, and then SQLite as appropriate. (yes this is the same paragraph as before, it's just that iconic π)
when checking against a CDB database, the password, the password with the first character removed, the last character removed, the first and last characters removed, the first two characters removed, and the last two characters removed will all be checked against the dictionary.
when checking a SQLite database, the password will be rejected if it is within edit distance one of any word in the dictionary, meaning that the database word can be formed from the password by deleting, adding, or changing a single character.
option two: use the normal dict_path setting. in the [realms] section of your krb5.conf or kdc.conf, under the appropriate realm or realms, specify the path to the dictionary:
dict_file = /path/to/cracklib/dictionary
this will be taken as a CrackLib dictionary path, the same as the setting for password_dictionary above. the provided path should be the full path to the dictionary files, omitting the trailing *.hwm, *.pwd, or *.pwi extension.
but heads up bestie, if you use this approach, you will probably want to disable the built-in standard dict pwqual plugin by adding the line:
disable = dict
to the pwqual block of the [plugins] section as shown above. otherwise, it will also try to load a dictionary at the same path to do simple dictionary matching. double-dipping, not cute. π
you can also mix and match these settings, by using dict_path for the CrackLib dictionary path and krb5.conf for the CDB or SQLite dictionary paths. if both settings are used for the CrackLib path, krb5.conf overrides the dict_path setting (so that dict_path can be used for other password quality modules). there is no way to specify a CDB or SQLite dictionary via the dict_path setting. hard no, sorry. π
β Other Settings β
the following additional settings are supported in the [appdefaults] section of krb5.conf when running under either Heimdal or MIT Kerberos. mutual settings, we love shared infrastructure π«Ά
cracklib_maxlenβ normally, all passwords are checked with CrackLib if a CrackLib dictionary is defined. however, CrackLib's rules were designed for a world in which most passwords were four to eight characters long, and it tends to spuriously reject a lot of passphrases. if this option is set to something other than its default of0, passwords longer than that length bypass CrackLib checks. (using a SQLite dictionary for longer passwords is strongly recommended.) so like, cracklib is a boomer with opinions, we work around it β¨minimum_differentβ if set to a numeric value, passwords with fewer than this number of unique characters will be rejected. this can be used to reject, for example, passwords that are long strings of the same character or repetitions of small numbers of characters, which may be too easy to guess.aaaaaaaaaaaabestie no πminimum_lengthβ if set to a numeric value, passwords with fewer than that number of characters will be rejected, independent of any length restrictions in CrackLib. note that this setting does not bypass the minimum length requirements in CrackLib itself (which, for the version embedded in this package, is eight characters). so you can't go under eight via this, only over. iykyk.require_ascii_printableβ if set to a true boolean value, rejects any password that contains non-ASCII characters or ASCII control characters. spaces are allowed; tabs are not (at least assuming the POSIX C locale). no canonicalization or character set is defined for Kerberos passwords in general, so you may want to reject non-ASCII characters to avoid interoperability problems with computers with different default character sets or Unicode normalization forms. tldr: keep it plain, keep it safe πΈrequire_classesβ this option allows specification of more complex character class requirements. the value of this parameter should be one or more whitespace-separated rule. each rule has the syntax:
[<min>-<max>:]<class>[,<class>...]
where <class> is one of upper, lower, digit, or symbol (without quote marks), or an integer representing a minimum number of character classes. the symbol class includes all characters other than alphanumeric characters, including space. the listed classes must appear in the password. separate multiple required classes with a comma (and no space).
the character class checks will be done in whatever locale the plugin or password check program is run in, which will normally be the POSIX C locale but may be different depending on local configuration. so like, your locale is lowkey the main character here π
a simple example:
require_classes = upper,lower,digit
this requires all passwords contain at least one uppercase letter, at least one lowercase letter, and at least one digit. and that's the rule, periodt. β¨
okay so if you drop <min> and <max> in there, they're the shortest and longest password length this rule applies to. that's how you can make character class requirements switch up based on how long the password is. so, like, for example:
require_classes = 8-19:upper,lower 8-15:digit 8-11:symbol
this means passwords from 8 to 11 characters long need all four character classes, passwords from 12 to 15 characters long need upper and lower case plus a digit, and passwords from 16 to 19 characters long need both upper and lower case. passwords longer than 20 characters have no character class restrictions. (this example is probably used with minimum_length = 8.)
require_classes also supports specifying the minimum number of character classes a password should contain. for example:
require_classes = 3
would require all passwords to have a minimum of any three of the character classes.
you can use this with <min> and <max> ranges too, like above. for example:
require_classes = 8-11:3 12-19:2
this requires all passwords from 8 to 11 characters to contain at least three different character classes, and passwords from 12 to 19 characters to contain at least two different character classes. ranges can overlap, like in the examples above, but this makes less sense when you're specifying a minimum number of classes.
minimum numbers of character classes can be combined with specific character classes. for example:
require_classes = symbol,3
requires all passwords to contain three distinct character classes and must contain a symbol character.
require_non_letterβ if set to a true boolean value, the password must contain at least one character that is not a letter (uppercase or lowercase) or a space. this may be helpful in combination with passphrases; users may choose a stock English phrase, and this will force at least some additional complexity.
you can omit any dictionary setting and only use the above settings. in that case, only the above checks and checks for passwords based on the principal will be done, bypassing any dictionary check. (but for that simple style of password strength checking, there are probably better strength checking plugins already available.)
π AUTHOR π
Russ Allbery <eagle@eyrie.org>
π COPYRIGHT AND LICENSE π
Copyright 2016 Russ Allbery <eagle@eyrie.org>
Copyright 2006-2007, 2009-2010, 2012-2014 The Board of Trustees of the Leland Stanford Junior University
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. this file is offered as-is, without any warranty.
SPDX-License-Identifier: FSFAP
π SEE ALSO π
and that's a wrap, bestie! this was krb5-strength(5) version 3.3, dated 2023-12-26. now go forth and slay those weak passwords π
β¨
π¦ where this page comes from
- debian trixie: krb5-strength 3.3-1 Β· MIT
- ubuntu noble: krb5-strength 3.3-1 Β· MIT
- ubuntu resolute: krb5-strength 3.3-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms