KRB5.CONF(5)

πŸ“¦ version 7.8.0, in epel 10, epel 9, fedora 43, fedora 44

πŸ’– krb5.conf(5) πŸ’– β€” configuration file for Kerberos 5

okay bestie, welcome to the File Formats Manual for krb5.conf(5) β€” yes, the config file that runs the Kerberos 5 library AND some programs too. No cap. 🫢

🌸 NAME 🌸

krb5.conf β€” configuration file for Kerberos 5

✨ SYNOPSIS ✨

vibe check: the synopsis is literally just one include. periodt. ✨

#include <krb5.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

now the DESCRIPTION? it's giving grammar lesson but make it Kerberos. πŸ¦‹

The krb5.conf file specifies several configuration parameters for the Kerberos 5 library, as well as for some programs.

The file consists of one or more sections, containing a number of bindings. The value of each binding can be either a string or a list of other bindings. The grammar looks like:

file:
        /* empty */
        sections

sections:
        section sections
        section

section:
        '[' section_name ']' bindings

section_name:
        STRING

bindings:
        binding bindings
        binding

binding:
        name '=' STRING
        name '=' '{' bindings '}'

name:
        STRING

STRINGs consists of one or more non-whitespace characters.

STRINGs that are specified later in this man-page uses the following notation.

lowkey this notation list is important, so don't skip it bestie. πŸ’–

  • boolean β€” values can be either yes/true or no/false.
  • time β€” values can be a list of year, month, day, hour, min, second. Example: 1 month 2 days 30 min. If no unit is given, seconds is assumed.
  • etypes β€” valid encryption types are: des-cbc-crc, des-cbc-md4, des-cbc-md5, des3-cbc-sha1, arcfour-hmac-md5, aes128-cts-hmac-sha1-96, and aes256-cts-hmac-sha1-96 .
  • address β€” an address can be either a IPv4 or a IPv6 address.

Currently recognised sections and bindings are:

πŸŽ€ [appdefaults] πŸŽ€

Specifies the default values to be used for Kerberos applications. You can specify defaults per application, realm, or a combination of these. The preference order is:

  1. application realm option
  2. application option
  3. realm option
  4. option

The supported options are:

  • forwardable = boolean β€” When obtaining initial credentials, make the credentials forwardable.
  • proxiable = boolean β€” When obtaining initial credentials, make the credentials proxiable.
  • no-addresses = boolean β€” When obtaining initial credentials, request them for an empty set of addresses, making the tickets valid from any address.
  • ticket_lifetime = time β€” Default ticket lifetime.
  • renew_lifetime = time β€” Default renewable ticket lifetime.
  • encrypt = boolean β€” Use encryption, when available.
  • forward = boolean β€” Forward credentials to remote host (for rsh(1), telnet(1), etc).
  • historical_anon_pkinit = boolean β€” Enable legacy anonymous pkinit command-line syntax. With this option set to true, the kinit(1) --anonymous command with no principal argument specified will request an anonymous pkinit ticket from the default realm. If a principal argument is specified, it is used as an explicit realm name for anonymous pkinit even without an @ prefix.

πŸ’œ [libdefaults] πŸ’œ

and now the sections? obsessed. ✨

  • default_realm = REALM β€” Default realm to use, this is also known as your β€œlocal realm”. The default is the result of krb5_get_host_realm(local hostname).
  • allow_weak_crypto = boolean β€” are weak crypto algorithms allowed to be used, among others, DES is considered weak.
  • clockskew = time β€” Maximum time differential (in seconds) allowed when comparing times. Default is 300 seconds (five minutes).
  • kdc_timeout = time β€” Maximum time to wait for a reply from the kdc, default is 3 seconds.
  • capath = { β€” destination-realm = next-hop-realm ... }. This is deprecated, see the capaths section below.
  • default_cc_type = cctype β€” sets the default credentials type.
  • default_cc_name = ccname β€” the default credentials cache name. If you want to change the type only use default_cc_type. The string can contain variables that are expanded on runtime. The Only supported variable currently is %{uid} which expands to the current user id.
  • default_etypes = etypes ... β€” A list of default encryption types to use. (Default: all enctypes if allow_weak_crypto = TRUE, else all enctypes except single DES enctypes.)
  • default_as_etypes = etypes ... β€” A list of default encryption types to use in AS requests. (Default: the value of default_etypes.)
  • default_tgs_etypes = etypes ... β€” A list of default encryption types to use in TGS requests. (Default: the value of default_etypes.)
  • default_etypes_des = etypes ... β€” A list of default encryption types to use when requesting a DES credential.
  • default_keytab_name = keytab β€” The keytab to use if no other is specified, default is β€œFILE:/etc/krb5.keytab”.
  • dns_lookup_kdc = boolean β€” Use DNS SRV records to lookup KDC services location.
  • dns_lookup_realm = boolean β€” Use DNS TXT records to lookup domain to realm mappings.
  • kdc_timesync = boolean β€” Try to keep track of the time differential between the local machine and the KDC, and then compensate for that when issuing requests.
  • max_retries = number β€” The max number of times to try to contact each KDC.
  • large_msg_size = number β€” The threshold where protocols with tiny maximum message sizes are not considered usable to send messages to the KDC.
  • ticket_lifetime = time β€” Default ticket lifetime.
  • renew_lifetime = time β€” Default renewable ticket lifetime.
  • forwardable = boolean β€” When obtaining initial credentials, make the credentials forwardable. This option is also valid in the [realms] section.
  • proxiable = boolean β€” When obtaining initial credentials, make the credentials proxiable. This option is also valid in the [realms] section.
  • verify_ap_req_nofail = boolean β€” If enabled, failure to verify credentials against a local key is a fatal error. The application has to be able to read the corresponding service key for this to work. Some applications, like su(1), enable this option unconditionally.
  • warn_pwexpire = time β€” How soon to warn for expiring password. Default is seven days.
  • http_proxy = proxy-spec β€” A HTTP-proxy to use when talking to the KDC via HTTP.
  • dns_proxy = proxy-spec β€” Enable using DNS via HTTP.
  • extra_addresses = address ... β€” A list of addresses to get tickets for along with all local addresses.
  • time_format = string β€” How to print time strings in logs, this string is passed to strftime(3).
  • date_format = string β€” How to print date strings in logs, this string is passed to strftime(3).
  • log_utc = boolean β€” Write log-entries using UTC instead of your local time zone.
  • scan_interfaces = boolean β€” Scan all network interfaces for addresses, as opposed to simply using the address associated with the system's host name.
  • fcache_version = int β€” Use file credential cache format version specified.
  • fcc-mit-ticketflags = boolean β€” Use MIT compatible format for file credential cache. It's the field ticketflags that is stored in reverse bit order for older than Heimdal 0.7. Setting this flag to TRUE makes it store the MIT way, this is default for Heimdal 0.7.
  • check-rd-req-server β€” If set to "ignore", the framework will ignore any of the server input to krb5_rd_req(3), this is very useful when the GSS-API server input the wrong server name into the gss_accept_sec_context call.
  • k5login_directory = directory β€” Alternative location for user .k5login files. This option is provided for compatibility with MIT krb5 configuration files.
  • k5login_authoritative = boolean β€” set this to true and, bestie, if a principal isn't found in the k5login files then krb5_userok(3) will not fall back on principal-to-username mapping. This one exists purely for compat with MIT krb5 config files. iykyk πŸ’…
  • kuserok = rule ... β€” this is the one that tells krb5_userok(3) how to behave. Drop multiple values in and krb5_userok(3) evaluates them in order, one at a time, until one succeeds or they all flop. The rules are implemented by plugins, and there are three built-in plugins described below. Default: USER-K5LOGIN SIMPLE DENY. ✨
  • kuserok = DENY β€” if this gets set and evaluated, krb5_userok(3) will deny access to the given username, no matter what the principal name is. Straight up no. 🚫
  • kuserok = SIMPLE β€” if this gets set and evaluated, krb5_userok(3) will use principal-to-username mapping (peep auth_to_local below). If the principal maps to the username that was requested, access is allowed. Simple! πŸŽ€
  • kuserok = SYSTEM-K5LOGIN[:directory] β€” if this gets set and evaluated, krb5_userok(3) will use k5login files named after the luser argument to krb5_userok(3), in the given directory or in /etc/k5login.d/. K5login files are text files, one principal name per line, and principals appearing in a user's k5login file are permitted access to that user's account.
Note: this rule performs no ownership nor permissions checks on k5login files; proper ownership and permissions/ACLs are expected due to the k5login location being a system location. πŸ‘‘
  • kuserok = USER-K5LOGIN β€” if this gets set and evaluated, krb5_userok(3) will use ~luser/.k5login and ~luser/.k5login.d/*. User k5login files and directories must be owned by the user and must not have world nor group write permissions. fr fr, it checks. πŸ”’
  • aname2lname-text-db = filename β€” the named file has to be a sorted (in increasing order) text file where every line is an unparsed principal name, optionally followed by whitespace and a username. The aname2lname function will do a binary search on this file, if configured, looking for lines that match the given principal name, and if found the given username will be used β€” or, if the username is missing, an error will be returned. If the file doesn't exist, or if no matching line is found, then other plugins are allowed to run. πŸ¦‹
  • fcache_strict_checking β€” strict checking in FILE credential caches that owner, no symlink and permissions is correct. πŸ•΅οΈβ€β™€οΈ
  • name_canon_rules = rules β€” one or more service principal name canonicalization rules. Each rule is one or more tokens separated by colon (':'). Currently these rules are used only for hostname canonicalization (usually when getting a service ticket, from a ccache or a TGS, but also when acquiring GSS initiator credentials from a keytab). These rules can be used to implement DNS resolver-like search lists without having to use DNS. 🧚
NOTE: Name canonicalization rules are an experimental feature. ⚠️

The first token is a rule type, one of: as-is, qualify, or nss.

Any remaining tokens must be options tokens: use_fast (use FAST to protect TGS exchanges; currently not supported), use_dnssec (use DNSSEC to protect hostname lookups; currently not supported), ccache_only, use_referrals, no_referrals, lookup_realm, mindots=N, maxdots=N, order=N, domain= domain, realm= realm, match_domain= domain, and match_realm= realm.

When trying to obtain a service ticket for a host-based service principal name, name canonicalization rules are applied to that name in the order given, one by one, until one succeds (a service ticket is obtained), or all fail. Similarly when acquiring GSS initiator credentials from a keytab, and when comparing a non-canonical GSS name to a canonical one. 🎯

For each rule the system checks that the hostname has at least mindots periods (if given) in it, at most maxdots periods (if given), that the hostname ends in the given match_domain (if given), and that the realm of the principal matches the match_realm (if given).

As-is rules leave the hostname unmodified but may set a realm. Qualify rules qualify the hostname with the given domain and also may set the realm. The nss rule uses the system resolver to lookup the host's canonical name and is usually not secure. Note that using the nss rule type implies having to have principal aliases in the HDB (though not necessarily in keytabs). πŸ‘€

The empty realm denotes "ask the client's realm's TGS". The empty realm may be set as well as matched.

The order in which rules are applied is as follows: first all the rules with explicit order, then all other rules in the order in which they appear. If any two rules have the same explicit order, their order of appearance in krb5.conf breaks the tie. Explicitly specifying order can be useful where tools read and write the configuration file without preserving parameter order. πŸŒ€

Malformed rules are ignored. πŸ’€

  • allow_hierarchical_capaths = boolean β€” when validating cross-realm transit paths, absent any explicit capath from the client realm to the server realm, allow a hierarchical transit path via the common ancestor domain of the two realms. Defaults to true. Note, absent an explicit setting, hierarchical capaths are always used by the KDC when generating a referral to a destination with which is no direct trust. 🌈

🌍 [domain_realm] πŸ—ΊοΈ

This is a list of mappings from DNS domain to Kerberos realm. Each binding in this section looks like:

domain = realm

The domain can be either a full name of a host or a trailing component, in the latter case the domain-string should start with a period. The trailing component only matches hosts that are in the same domain, ie β€œ.example.com” matches β€œfoo.example.com”, but not β€œfoo.test.example.com”. πŸ‘‘

The realm may be the token dns_locate, in which case the actual realm will be determined using DNS (independently of the setting of the dns_lookup_realm option). πŸ›°οΈ


πŸ‘‘ [realms] πŸ’–

REALM = {
  • kdc = [service/]host[:port] β€” specifies a list of kdcs for this realm. If the optional port is absent, the default value for the β€œkerberos/udp”, β€œkerberos/tcp”, and β€œhttp/tcp” port (depending on service) will be used. The kdcs will be used in the order that they are specified.

The optional service specifies over what medium the kdc should be contacted. Possible services are β€œudp”, β€œtcp”, and β€œhttp”. Http can also be written as β€œhttp://”. Default service is β€œudp” and β€œtcp”. πŸ“‘

  • admin_server = host[:port] β€” specifies the admin server for this realm, where all the modifications to the database are performed. πŸ› οΈ
  • kpasswd_server = host[:port] β€” points to the server where all the password changes are performed. If there is no such entry, the kpasswd port on the admin_server host will be tried. πŸ”‘
  • tgs_require_subkey β€” a boolan variable that defaults to false. Old DCE secd (pre 1.1) might need this to be true. 😭
  • auth_to_local_names = {
  • principal_name = username β€” this maps that principal_name over to that username, but only if the REALM is a default realm. cute and conditional, we love a boundary πŸ’…

okay so the auth_to_local value can be one of these options πŸ‘‡ pick your fighter

  • auth_to_local = HEIMDAL_DEFAULT β€” uses the Heimdal default principal-to-username mapping. Applies to principals from the REALM if and only if REALM is a default realm. no cap πŸ¦‹
  • auth_to_local = DEFAULT β€” uses the MIT default principal-to-username mapping. Applies to principals from the REALM if and only if REALM is a default realm. same energy, different team ✨
  • auth_to_local = DB:/path/to/db.txt β€” does a binary search of the DB you point at. That DB has to be a flat-text file sorted in the "C" locale, and every record is one line (separated by either LF or CRLF) made of a principal name, then whitespace, then a username. Applies to principals from the REALM if and only if REALM is a default realm. literally so specific bestie, respect the format πŸŽ€
  • auth_to_local = DB:/path/to/db β€” uses the given DB, but only if there's a plugin for it. Applies to principals from the REALM if and only if REALM is a default realm.
  • auth_to_local = RULE:... β€” uses the given rule, but again only if there's a plugin for it. Applies to principals from the REALM if and only if REALM is a default realm.
  • auth_to_local = NONE β€” no additional principal-to-username mapping happens. ⚠️ heads up though: auth_to_local_names and any preceding auth_to_local rules still have precedence over this. they eat first, periodt πŸ“

🌈 [capaths] 🌈

[capaths]
    client-realm = {
        server-realm = hop-realm ...
    }
  • client-realm β†’ server-realm = hop-realm ... β€” this one is doing two jobs at once, main character behavior honestly πŸ‘‘
    1. First, the first listed hop-realm tells a client which realm it should contact in order to ultimately obtain credentials for a service in the server-realm.
    2. Secondly, it tells the KDC (and other servers) which realms are allowed in a multi-hop traversal from client-realm to server-realm.
Except for the client case, the order of the realms is not important. 🫢

πŸŽ€ [logging] πŸŽ€

  • entity = destination β€” says that entity should use the specified destination for logging. Wanna know what destinations actually exist? Go peek at the krb5_openlog(3) manual page for the full list of defined destinations. iykyk πŸ“–βœ¨

πŸ”₯ [kdc] πŸ”₯

the database block

[kdc]
    database = {
        ...
    }
  • dbname = [DATBASETYPE:]DATABASENAME β€” use this database for this realm. The DATABASETYPE should be one of 'lmdb', 'db3', 'db1', 'db', 'sqlite', or 'ldap'. See the info documentation for how to configure different database backends. choose wisely bestie πŸ’€
  • realm = REALM β€” specifies the realm that will be stored in this database. If the realm isn't set, it will be used as the default database, and there can only be one entry that doesn't have a realm stanza. one (1) single default, no duplicates allowed 🚫
  • mkey_file = FILENAME β€” use this keytab file for the master key of this database. If you don't specify it, DATABASENAME.mkey will be used. default behavior said "I got it" πŸ’…
  • acl_file = PA FILENAME β€” use this file for the ACL list of this database.
  • log_file = FILENAME β€” use this file as the log of changes performed to the database. This file is used by ipropd-master for propagating changes to slaves. It's also used by kadmind and kadmin (when used with the -l option), and by all applications using libkadm5 with the local backend, for two-phase commit functionality. Slaves also use this. Setting this to /dev/null disables two-phase commit and incremental propagation. Use iprop-log to show the contents of this log file. ⚠️ yeah /dev/null is a real choice with real consequences, be careful 🚨
  • log-max-size = number β€” when the log reaches this size (in bytes), the log gets truncated, saving some entries and keeping the latest version number so as to not disrupt incremental propagation. If you set it to a negative value, automatic log truncation is disabled. Defaults to 52428800 (50MB). ✨

the rest of the [kdc] options

  • max-request = SIZE β€” maximum size of a kdc request.
  • require-preauth = BOOL β€” if set, pre-authentication is required.
  • ports = list of ports β€” list of ports the kdc should listen to.
  • addresses = list of interfaces β€” list of addresses the kdc should bind to.
  • enable-http = BOOL β€” should the kdc answer kdc-requests over http.
  • tgt-use-strongest-session-key = BOOL β€” if this is TRUE then the KDC will prefer the strongest key from the client's AS-REQ or TGS-REQ enctype list for the ticket session key that is supported by the KDC and the target principal when the target principal is a krbtgt principal. Else it will prefer the first key from the client's AS-REQ enctype list that is also supported by the KDC and the target principal. Defaults to FALSE.
  • svc-use-strongest-session-key = BOOL β€” like tgt-use-strongest-session-key, but applies to the session key enctype of tickets for services other than krbtgt principals. Defaults to FALSE.
  • preauth-use-strongest-session-key = BOOL β€” if TRUE then select the strongest possible enctype from the client's AS-REQ for PA-ETYPE-INFO2 (i.e., for password-based pre-authentication). Else pick the first supported enctype from the client's AS-REQ. Defaults to FALSE.
  • use-strongest-server-key = BOOL β€” if TRUE then the KDC picks, for the ticket encrypted part's key, the first supported enctype from the target service principal's hdb entry's current keyset. Else the KDC picks the first supported enctype from the target service principal's hdb entry's current keyset. Defaults to TRUE. (yes bestie it really does say the same thing both ways, we're just reporting the lore as-is πŸ™ˆ)
  • check-ticket-addresses = BOOL β€” verify the addresses in the tickets used in tgs requests.
  • allow-null-ticket-addresses = BOOL β€” allow address-less tickets.
  • allow-anonymous = BOOL β€” if the kdc is allowed to hand out anonymous tickets.
  • historical_anon_realm = boolean β€” enables pre-7.0 non-RFC-conformant KDC behavior. With this option set to true the client realm in anonymous pkinit AS replies will be the requested realm, rather than the RFC-conformant WELLKNOWN:ANONYMOUS realm.
🚨 This can have a security impact on servers that expect to grant access to anonymous-but-authenticated to the KDC users of the realm in question: they would also grant access to unauthenticated anonymous users. As such, it is not recommend to set this option to true. like genuinely, don't. πŸ’€
  • encode_as_rep_as_tgs_rep = BOOL β€” encode as-rep as tgs-rep to be compatible with mistakes older DCE secd did. (we're being polite about it πŸŽ€)
  • kdc_warn_pwexpire = TIME β€” the time before expiration that the user should be warned that her password is about to expire.
  • logging = Logging β€” what type of logging the kdc should use, see also [logging]/kdc. 🌸
  • hdb-ldap-structural-object structural object β€” bestie if you're storing principals in the LDAP backend, THIS is the structural object used when creating and when reading objects. The default value is account . πŸ’…
  • hdb-ldap-create-base creation dn β€” the dn that gets appended to the principal when creating entries. Default value is the search dn.
  • enable-digest = BOOL β€” should the kdc answer digest requests? The default is FALSE. πŸ™ˆ
  • digests_allowed = list of digests β€” tells you which digests the kdc will reply to. The default is ntlm-v2.
  • kx509_ca = file β€” the PEM credentials for the kx509 certification authority. πŸ”₯
  • require_initial_kca_tickets = boolean β€” says whether to require that tickets for the kca_service service principal be INITIAL. You can set this per-realm or globally. Defaults to true for the global setting.
  • kx509_include_pkinit_san = boolean β€” if true then the kx509 client principal's name and realm get included in an id-pkinit-san certificate extension. Per-realm or global, your call. Defaults to true for the global setting. ✨
  • kx509_template = file β€” the PEM file with a template for the certificates to be issued. You can interpolate the following variables in the subject name using ${variable} syntax:
    • principal-name β€” the full name of the kx509 client principal.
    • principal-name-without-realm β€” the full name of the kx509 client principal, excluding the realm name.
    • principal-name-realm β€” the name of the client principal's realm.
Heads up queen πŸ‘‘ β€” the kx509, kx509_template, kx509_include_pkinit_san, and require_initial_kca_tickets parameters may be set on a per-realm basis as well.

πŸŽ€ [kadmin] πŸŽ€

  • password_lifetime = time β€” if a principal already has its password set for expiration, this is the time it'll be valid for after a change.
  • default_keys = keytypes... β€” for each entry in default_keys, it tries to parse it as a sequence of etype:salttype:salt syntax, like this:
[(des|des3|etype):](pw-salt|afs3-salt)[:string]

If etype is omitted it means everything, and if string is omitted it means the default salt string (for that principal and encryption type). Additional special values of keytypes are:

  • v5 β€” the Kerberos 5 salt pw-salt
  • default_key_rules = {
    • globing-rule = keytypes... β€” a globbing rule to matching a principal, and when true, use the keytypes as specified the same format as [kadmin]default_keys .

}

  • prune-key-history = BOOL β€” when adding keys to the key history, drop keys that are too old to match unexpired tickets (based on the principal's maximum ticket lifetime). If the KDC keystore is later compromised, traffic protected with the discarded older keys may remain protected. This also keeps the HDB records for principals with key history from growing without bound. The default (backwards compatible) value is "false". 😭
  • use_v4_salt = BOOL β€” when true, this is the same as
default_keys = des3:pw-salt v4

and is only left for backwards compatibility.

  • [password_quality] β€” check the Password quality assurance in the info documentation for more information. 🧚
    • check_library = library-name β€” library name that contains the password check_function
    • check_function = function-name β€” function name for checking passwords in check_library
    • policy_libraries = library1 ... libraryN β€” list of libraries that can do password policy checks
    • policies = policy1 ... policyN β€” list of policy names to apply to the password. Builtin policies are among other minimum-length, character-class, external-check.

🌈 ENVIRONMENT 🌈

  • KRB5_CONFIG points to the configuration file to read.

πŸ“ FILES πŸ“

  • /etc/krb5.conf β€” configuration file for Kerberos 5.

✨ EXAMPLES ✨

Lowkey the moment you've been waiting for, bestie β€” a whole config, served fresh:

[libdefaults]
        default_realm = FOO.SE
        name_canon_rules = as-is:realm=FOO.SE
        name_canon_rules = qualify:domain=foo.se:realm=FOO.SE
        name_canon_rules = qualify:domain=bar.se:realm=FOO.SE
        name_canon_rules = nss
[domain_realm]
        .foo.se = FOO.SE
        .bar.se = FOO.SE
[realms]
        FOO.SE = {
                kdc = kerberos.foo.se
                default_domain = foo.se
        }
[logging]
        kdc = FILE:/var/heimdal/kdc.log
        kdc = SYSLOG:INFO
        default = SYSLOG:INFO:USER
[kadmin]
        default_key_rules = {
                */ppp@* = arcfour-hmac-md5:pw-salt
        }

πŸ’€ DIAGNOSTICS πŸ’€

Since krb5.conf is read and parsed by the krb5 library, there is not a lot of opportunities for programs to report parsing errors in any useful format. 😭 To help overcome this problem, there is a program verify_krb5_conf that reads krb5.conf and tries to emit useful diagnostics from parsing errors.

Not me being the bearer of bad news but β€” note that this program does not have any way of knowing what options are actually used and thus cannot warn about unknown or misspelled ones. So typos will simply ✨vibe✨. iykyk.

πŸ¦‹ SEE ALSO πŸ¦‹


And that's a wrap on the whole page, bestie!! 🫢 This iconic little manual is brought to you by HEIMDAL, dated May 4, 2005, and it's the one and only KRB5.CONF(5). Slay, go configure your realm, you've got this. πŸ’–πŸŽ€

πŸ“¦ where this page comes from