KRB5.CONF(5)
π 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/trueorno/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, andaes256-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:
- application realm option
- application option
- realm option
- 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 (forrsh(1),telnet(1), etc).historical_anon_pkinit = booleanβ Enable legacy anonymous pkinit command-line syntax. With this option set totrue, thekinit(1)--anonymouscommand 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 ofkrb5_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 is300seconds (five minutes).kdc_timeout = timeβ Maximum time to wait for a reply from the kdc, default is3seconds.capath = {βdestination-realm = next-hop-realm...}. This is deprecated, see thecapathssection 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 usedefault_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 ifallow_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 ofdefault_etypes.)default_tgs_etypes = etypes ...β A list of default encryption types to use in TGS requests. (Default: the value ofdefault_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, likesu(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 tostrftime(3).date_format = stringβ How to print date strings in logs, this string is passed tostrftime(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 toTRUEmakes 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 tokrb5_rd_req(3), this is very useful when the GSS-API server input the wrong server name into thegss_accept_sec_contextcall.k5login_directory = directoryβ Alternative location for user.k5loginfiles. 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 thenkrb5_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 tellskrb5_userok(3)how to behave. Drop multiple values in andkrb5_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 (peepauth_to_localbelow). 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 tokrb5_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/.k5loginand~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. Theaname2lnamefunction 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 totrue. 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 theadmin_serverhost will be tried. πtgs_require_subkeyβ a boolan variable that defaults tofalse. Old DCE secd (pre 1.1) might need this to betrue. π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_namesand any precedingauth_to_localrules 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 π- First, the first listed
hop-realmtells a client which realm it should contact in order to ultimately obtain credentials for a service in the server-realm. - Secondly, it tells the KDC (and other servers) which realms are allowed in a multi-hop traversal from client-realm to server-realm.
- First, the first listed
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 thekrb5_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. TheDATABASETYPEshould 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.mkeywill 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 byipropd-masterfor propagating changes to slaves. It's also used bykadmindandkadmin(when used with the-loption), and by all applications usinglibkadm5with the local backend, for two-phase commit functionality. Slaves also use this. Setting this to/dev/nulldisables two-phase commit and incremental propagation. Useiprop-logto show the contents of this log file. β οΈ yeah/dev/nullis 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 to52428800(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 isTRUEthen the KDC will prefer the strongest key from the client'sAS-REQorTGS-REQenctype 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'sAS-REQenctype list that is also supported by the KDC and the target principal. Defaults toFALSE.svc-use-strongest-session-key = BOOLβ liketgt-use-strongest-session-key, but applies to the session key enctype of tickets for services other than krbtgt principals. Defaults toFALSE.preauth-use-strongest-session-key = BOOLβ ifTRUEthen select the strongest possible enctype from the client'sAS-REQforPA-ETYPE-INFO2(i.e., for password-based pre-authentication). Else pick the first supported enctype from the client'sAS-REQ. Defaults toFALSE.use-strongest-server-key = BOOLβ ifTRUEthen 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 toTRUE. (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 totruethe client realm in anonymous pkinit AS replies will be the requested realm, rather than the RFC-conformantWELLKNOWN:ANONYMOUSrealm.
π¨ 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-objectstructural 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 isaccount. πhdb-ldap-create-basecreation 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 isFALSE. πdigests_allowed = list of digestsβ tells you which digests the kdc will reply to. The default isntlm-v2.kx509_ca = fileβ the PEM credentials for the kx509 certification authority. π₯require_initial_kca_tickets = booleanβ says whether to require that tickets for thekca_serviceservice principal beINITIAL. You can set this per-realm or globally. Defaults totruefor the global setting.kx509_include_pkinit_san = booleanβ if true then the kx509 client principal's name and realm get included in anid-pkinit-sancertificate extension. Per-realm or global, your call. Defaults totruefor 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 π β thekx509,kx509_template,kx509_include_pkinit_san, andrequire_initial_kca_ticketsparameters 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 indefault_keys, it tries to parse it as a sequence ofetype:salttype:saltsyntax, 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 saltpw-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 passwordcheck_functioncheck_function = function-nameβ function name for checking passwords incheck_librarypolicy_libraries = library1 ... libraryNβ list of libraries that can do password policy checkspolicies = policy1 ... policyNβ list of policy names to apply to the password. Builtin policies are among otherminimum-length,character-class,external-check.
π ENVIRONMENT π
KRB5_CONFIGpoints 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
- epel 10: heimdal-libs 7.8.0-26.el10_2 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- epel 9: heimdal-libs 7.8.0-5.el9 Β· BSD and MIT
- fedora 43: heimdal-libs 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 43: heimdal-libs 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-libs 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-libs 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-libs 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-libs 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- Copyright (c) 1999 - 2005 Kungliga Tekniska HΓΆgskolan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms