SSSD-KRB5(5)

๐Ÿ’– SSSD-KRB5(5) ๐Ÿ’–

okay so welcome to SSSD-KRB5(5), bestie โ€” it lives in the File Formats and Conventions part of the manual and it's all about the SSSD Kerberos provider. Grab a snack, we're going in ๐Ÿซถ


๐ŸŽ€ NAME ๐ŸŽ€

sssd-krb5 โ€” the SSSD Kerberos provider. that's it, that's the name โœจ


๐ŸŒธ DESCRIPTION ๐ŸŒธ

So this page is literally the whole guide to configuring the Kerberos 5 authentication backend for sssd(8). If you want the full detailed syntax reference (the nerdy fine print, and I say that with love), go read the FILE FORMAT section of the sssd.conf(5) manual page. That's where all the format rules live ๐Ÿ’…

The Kerberos 5 authentication backend comes with two providers inside it: auth and chpass. But here's the tea โ€” it cannot just do its thing on its own. It has to be paired with an identity provider or it won't function properly, periodt. Like, for example, id_provider = ldap. ๐Ÿ‘‘

Some of the info that the Kerberos 5 authentication backend needs has to be handed to it by the identity provider โ€” and the big one is the user's Kerberos Principal Name (UPN). So the identity provider's config should have an entry that specifies the UPN. Wanna know exactly how to set that up? Go check the man page for whichever identity provider you're using, it'll walk you through it. iykyk ๐ŸŒˆ

This backend also gives you access control based on the .k5login file that lives in the user's home directory. See k5login(5) for more details on that whole situation ๐Ÿฆ‹

โš ๏ธ okay important, bestie: an empty .k5login file will deny all access to this user. like, all of it. no cap. ๐Ÿ’€

To activate this feature, drop access_provider = krb5 into your SSSD configuration and you're slaying โœจ

And one more lil thing โ€” in the case where the UPN is not available in the identity backend, sssd will just construct a UPN for you using the format username@krb5_realm. iconic behaviour honestly ๐ŸŽ€


okay that's the setup, and there is so much more coming โ€” hold on to your seats, this page keeps going ๐Ÿ’–

โœจ CONFIGURATION OPTIONS โœจ

okay bestie, if the auth-module krb5 is used in an SSSD domain, the following options must be used. see the sssd.conf(5) manual page, section โ€œDOMAIN SECTIONSโ€, for the deets on configuring an SSSD domain. ๐Ÿ’–


  • krb5_server, krb5_backup_server (string) โ€” specifies the comma-separated list of IP addresses or hostnames of the Kerberos servers SSSD should connect to, in order of preference. for failover and server redundancy tea, see the โ€œFAILOVERโ€ section. an optional port number (preceded by a colon) may be appended to the addresses or hostnames. if empty, service discovery is enabled; for more info, refer to the โ€œSERVICE DISCOVERYโ€ section.

when using service discovery for KDC or kpasswd servers, SSSD first searches for DNS entries that specify _udp as the protocol and falls back to _tcp if none are found.

๐Ÿ•ฐ๏ธ this option was named โ€œkrb5_kdcipโ€ in earlier releases of SSSD. while the legacy name is recognized for the time being, users are advised to migrate their config files to use โ€œkrb5_serverโ€ instead. no cap.
  • krb5_realm (string) โ€” the name of the Kerberos realm. this one is required and must be specified. periodt.
  • krb5_kpasswd, krb5_backup_kpasswd (string) โ€” if the change password service is not running on the KDC, alternative servers can be defined here. an optional port number (preceded by a colon) may be appended to the addresses or hostnames.

for more info on failover and server redundancy, see the โ€œFAILOVERโ€ section.

โš ๏ธ NOTE: even if there are no more kpasswd servers to try, the backend is not switched to operate offline if authentication against the KDC is still possible. iykyk.

Default: Use the KDC

  • krb5_ccachedir (string) โ€” directory to store credential caches. all the substitution sequences of krb5_ccname_template can be used here, too, except %d and %P. the directory is created as private and owned by the user, with permissions set to 0700. ๐Ÿ’…

Default: /tmp

  • krb5_ccname_template (string) โ€” location of the user's credential cache. three credential cache types are currently supported: โ€œFILEโ€, โ€œDIRโ€ and โ€œKEYRING:persistentโ€. the cache can be specified either as TYPE:RESIDUAL, or as an absolute path, which implies the โ€œFILEโ€ type. in the template, the following sequences are substituted:
    • %u โ€” login name
    • %U โ€” login UID
    • %p โ€” principal name
    • %r โ€” realm name
    • %h โ€” home directory
    • %d โ€” value of krb5_ccachedir
    • %P โ€” the process ID of the SSSD client
    • %% โ€” a literal %

if the template ends with XXXXXX, mkstemp(3) is used to create a unique filename in a safe way.

when using KEYRING types, the only supported mechanism is โ€œKEYRING:persistent:%Uโ€, which uses the Linux kernel keyring to store credentials on a per-UID basis. this is also the recommended choice, as it is the most secure and predictable method. โœจ

the default value for the credential cache name is sourced from the profile stored in the system wide krb5.conf configuration file in the [libdefaults] section. the option name is default_ccache_name. see krb5.conf(5)'s PARAMETER EXPANSION paragraph for additional info on the expansion format defined by krb5.conf.

๐Ÿ’€ NOTE: please be aware that libkrb5 ccache expansion template from krb5.conf(5) uses different expansion sequences than SSSD. don't get it twisted.

Default: (from libkrb5)

  • krb5_keytab (string) โ€” the location of the keytab to use when validating credentials obtained from KDCs.

Default: System keytab, normally /etc/krb5.keytab

  • krb5_store_password_if_offline (boolean) โ€” store the password of the user if the provider is offline and use it to request a TGT when the provider comes online again.
โš ๏ธ NOTE: this feature is only available on Linux. passwords stored in this way are kept in plaintext in the kernel keyring and are potentially accessible by the root user (with difficulty). bestie be careful.

Default: false

  • krb5_use_fast (string) โ€” enables flexible authentication secure tunneling (FAST) for Kerberos pre-authentication. the following options are supported:
    • never โ€” use FAST. this is equivalent to not setting this option at all.
    • try โ€” use FAST. if the server does not support FAST, continue the authentication without it.
    • demand โ€” use FAST. the authentication fails if the server does not require fast.

Default: not set, i.e. FAST is not used.

โš ๏ธ NOTE: a keytab or support for anonymous PKINIT is required to use FAST. โš ๏ธ NOTE: SSSD supports FAST only with MIT Kerberos version 1.8 and later. if SSSD is used with an older version of MIT Kerberos, using this option is a configuration error. ๐Ÿ’€
  • krb5_fast_principal (string) โ€” specifies the server principal to use for FAST.
  • krb5_fast_use_anonymous_pkinit (boolean) โ€” if set to true, try to use anonymous PKINIT instead of a keytab to get the required credential for FAST. the krb5_fast_principal option is ignored in this case.

Default: false

  • krb5_use_kdcinfo (boolean) โ€” specifies if SSSD should instruct the Kerberos libraries what realm and which KDCs to use. this option is on by default. if you disable it, you need to configure the Kerberos library using the krb5.conf(5) configuration file.

see the sssd_krb5_locator_plugin(8) manual page for more info on the locator plugin.

Default: true

  • krb5_kdcinfo_lookahead (string) โ€” when krb5_use_kdcinfo is set to true, you can limit the amount of servers handed to sssd_krb5_locator_plugin(8). this might be helpful when there are too many servers discovered using SRV record.

the krb5_kdcinfo_lookahead option contains two numbers separated by a colon. the first number represents the number of primary servers used and the second number specifies the number of backup servers.

for example 10:0 means that up to 10 primary servers will be handed to sssd_krb5_locator_plugin(8) but no backup servers.

Default: 3:1

  • krb5_use_enterprise_principal (boolean) โ€” specifies if the user principal should be treated as enterprise principal. see section 5 of RFC 6806 for more details about enterprise principals.

Default: false (AD provider: true)

the IPA provider will set to option to 'true' if it detects that the server is capable of handling enterprise principals and the option is not set explicitly in the config file.

  • krb5_use_subdomain_realm (boolean) โ€” specifies to use subdomains realms for the authentication of users from trusted domains. this option can be set to 'true' if enterprise principals are used with upnSuffixes which are not known on the parent domain KDCs. if the option is set to 'true', SSSD will try to send the request directly to a KDC of the trusted domain the user is coming from.

Default: false

  • krb5_map_user (string) โ€” the list of mappings is given as a comma-separated list of pairs โ€œusername:primaryโ€ where โ€œusernameโ€ is a UNIX user name and โ€œprimaryโ€ is a user part of a kerberos principal. this mapping is used when user is authenticating using โ€œauth_provider = krb5โ€.

example:

krb5_realm = REALM
krb5_map_user = joe:juser,dick:richard

โ€œjoeโ€ and โ€œdickโ€ are UNIX user names and โ€œjuserโ€ and โ€œrichardโ€ are primaries of kerberos principals. for user โ€œjoeโ€ resp. โ€œdickโ€ SSSD will try to kinit as โ€œjuser@REALMโ€ resp. โ€œrichard@REALMโ€.

Default: not set

  • krb5_auth_timeout (integer) โ€” timeout in seconds after an online authentication request or change password request is aborted. if possible, the authentication request is continued offline.

Default: 6

  • krb5_validate (boolean) โ€” verify with the help of krb5_keytab that the TGT obtained has not been spoofed. the keytab is checked for entries sequentially, and the first entry with a matching realm is used for validation. if no entry matches the realm, the last entry in the keytab is used. this process can be used to validate environments using cross-realm trust by placing the appropriate keytab entry as the last entry or the only entry in the keytab file.

Default: false (IPA and AD provider: true)

๐Ÿ‘‘ please note that ticket validation is the first step when checking the PAC (see 'pac_check' in the sssd.conf(5) manual page for details). if ticket validation is disabled, the PAC checks will be skipped as well.
  • krb5_renewable_lifetime (string) โ€” request a renewable ticket with a total lifetime, given as an integer immediately followed by a time unit:
    • s โ€” for seconds
    • m โ€” for minutes
    • h โ€” for hours
    • d โ€” for days.

if there is no unit given, s is assumed.

โš ๏ธ NOTE: it is not possible to mix units. to set the renewable lifetime to one and a half hours, use '90m' instead of '1h30m'.

Default: not set, i.e. the TGT is not renewable

  • krb5_lifetime (string) โ€” request ticket with a lifetime, given as an integer immediately followed by a time unit:
    • s โ€” for seconds
    • m โ€” for minutes
    • h โ€” for hours
    • d โ€” for days.

if there is no unit given s is assumed.

โš ๏ธ NOTE: it is not possible to mix units. to set the lifetime to one and a half hours please use '90m' instead of '1h30m'.

Default: not set, i.e. the default ticket lifetime configured on the KDC.

  • krb5_renew_interval (string) โ€” the time in seconds between two checks if the TGT should be renewed. TGTs are renewed if about half of their lifetime is exceeded, given as an integer immediately followed by a time unit:
    • s โ€” for seconds
    • m โ€” for minutes
    • h โ€” for hours
    • d โ€” for days.

if there is no unit given, s is assumed.

โš ๏ธ NOTE: it is not possible to mix units. to set the renewable lifetime to one and a half hours, use '90m' instead of '1h30m'.

if this option is not set or is 0, the automatic renewal is disabled.

Default: not set

  • krb5_canonicalize (boolean) โ€” specifies if the host and user principal should be canonicalized. this feature is available with MIT Kerberos 1.7 and later versions.

Default: false

๐Ÿ” FAILOVER

okay bestie, so the failover feature is literally the glow-up that lets back ends automatically switch to a different server if the current server is being a flop. iconic behavior honestly. ๐Ÿ’…

Failover Syntax โœจ

The list of servers is given as a comma-separated list; any number of spaces is allowed around the comma. The servers are listed in order of preference. The list can contain any number of servers.

For each failover-enabled config option, two variants exist: primary and backup. The idea is that servers in the primary list are preferred and backup servers are only searched if no primary servers can be reached. If a backup server is selected, a timeout of 31 seconds is set. After this timeout SSSD will periodically try to reconnect to one of the primary servers. If it succeeds, it will replace the current active (backup) server. no cap, it's giving "we'll keep your ex on speed dial just in case" energy ๐Ÿซถ

The Failover Mechanism ๐Ÿฆ‹

The failover mechanism distinguishes between a machine and a service. The back end first tries to resolve the hostname of a given machine; if this resolution attempt fails, the machine is considered offline. No further attempts are made to connect to this machine for any other service. If the resolution attempt succeeds, the back end tries to connect to a service on this machine. If the service connection attempt fails, then only this particular service is considered offline and the back end automatically switches over to the next service. The machine is still considered online and might still be tried for another service. it's giving "the machine is fine, it's just that ONE service that's being dramatic" ๐Ÿ˜ญ

Further connection attempts are made to machines or services marked as offline after a specified period of time; this is currently hard coded to 30 seconds.

If there are no more machines to try, the back end as a whole switches to offline mode, and then attempts to reconnect every 30 seconds. ๐Ÿ’€

Failover time outs and tuning โฑ๏ธ

Resolving a server to connect to can be as simple as running a single DNS query or can involve several steps, such as finding the correct site or trying out multiple host names in case some of the configured servers are not reachable. The more complex scenarios can take some time and SSSD needs to balance between providing enough time to finish the resolution process but on the other hand, not trying for too long before falling back to offline mode. If the SSSD debug logs show that the server resolution is timing out before a live server is contacted, you can consider changing the time outs.

This section lists the available tunables. Please refer to their description in the sssd.conf(5), manual page.

  • dns_resolver_server_timeout โ€” Time in milliseconds that sets how long would SSSD talk to a single DNS server before trying next one.

Default: 1000

  • dns_resolver_op_timeout โ€” Time in seconds to tell how long would SSSD try to resolve single DNS query (e.g. resolution of a hostname or an SRV record) before trying the next hostname or discovery domain.

Default: 3

  • dns_resolver_timeout โ€” How long would SSSD try to resolve a failover service. This service resolution internally might include several steps, such as resolving DNS SRV queries or locating the site.

Default: 6

For LDAP-based providers, the resolve operation is performed as part of an LDAP connection operation. Therefore, also the โ€œldap_opt_timeoutโ€ timeout should be set to a larger value than โ€œdns_resolver_timeoutโ€ which in turn should be set to a larger value than โ€œdns_resolver_op_timeoutโ€ which should be larger than โ€œdns_resolver_server_timeoutโ€. it's a whole nesting-doll situation bestie, keep the vibes in order ๐Ÿ‘‘


๐Ÿ” SERVICE DISCOVERY

The service discovery feature allows back ends to automatically find the appropriate servers to connect to using a special DNS query. This feature is not supported for backup servers. ๐Ÿ™ˆ

Configuration ๐ŸŽ€

If no servers are specified, the back end automatically uses service discovery to try to find a server. Optionally, the user may choose to use both fixed server addresses and service discovery by inserting a special keyword, โ€œ_srv_โ€, in the list of servers. The order of preference is maintained. This feature is useful if, for example, the user prefers to use service discovery whenever possible, and fall back to a specific server when no servers can be discovered using DNS. obsessed with the flexibility ngl ๐ŸŒˆ

The domain name ๐ŸŒธ

Please refer to the โ€œdns_discovery_domainโ€ parameter in the sssd.conf(5) manual page for more details.

The protocol ๐Ÿ’œ

The queries usually specify _tcp as the protocol. Exceptions are documented in respective option description.

See Also โญ

For more information on the service discovery mechanism, refer to RFC 2782.


๐Ÿงช EXAMPLE

The following example assumes that SSSD is correctly configured and FOO is one of the domains in the [sssd] section. This example shows only configuration of Kerberos authentication; it does not include any identity provider.

[domain/FOO]
auth_provider = krb5
krb5_server = 192.168.1.1
krb5_realm = EXAMPLE.COM

like, it's a snack-sized config, but it does the job bestie ๐Ÿ“


๐Ÿ‘€ SEE ALSO

sssd(8), sssd.conf(5), sssd-ldap(5), sssd-ldap-attributes(5), sssd-krb5(5), sssd-simple(5), sssd-ipa(5), sssd-ad(5), sssd-idp(5), sssd-sudo(5), sssd-session-recording(5), sss_cache(8), sss_debuglevel(8), sss_obfuscate(8), sss_seed(8), sssd_krb5_locator_plugin(8), sss_ssh_authorizedkeys(1), sss_ssh_knownhosts(1), sssd-ifp(5), pam_sss(8). sss_rpcidmapd(5) sssd-systemtap(5)


๐Ÿ’– AUTHORS

The SSSD upstream - https://github.com/SSSD/sssd/


and that's a wrap on the whole page, bestie!! ๐ŸŽ‰ this version came from the SSSD project, dated 07/08/2026, and it's the SSSD-KRB5(5) manual page fr fr. go forth and configure your Kerberos domain, you absolute icon ๐Ÿ‘‘โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from