I am using both Red Hat and Ubuntu, but I'll start with Ubuntu (18.04.6).
I want to authenticate with two KRB5 realms (not joined to AD); I'll call them REALM1 and REALM2. Some users are in REALM1, others are in REALM2. I configured krb5.conf and sssd.conf with both realms.
You have to select a default realm in krb5.conf, so I picked REALM1 at random.
If I use kinit, it will always check REALM1 but not REALM2. I guess I can live with that.
I set up SSSD; it doesn't ask for a default realm. I can log in with a REALM1 username, but not a REALM2 username. Looking at logs, it looks like it only tries the first realm.
I'd like a user to be able to just enter their username (without realm) and the system tries both realms. How can I configure this?
Here's how my sssd.conf is set up:
[sssd]
services = nss, pam
domains = REALM1, REALM2
[domain/REALM2]
id_provider = proxy
proxy_lib_name=files
auth_provider = krb5
krb5_realm = REALM2
krb5_validate = false
krb5_server = kdc1address
[domain/REALM1]
id_provider = proxy
proxy_lib_name=files
auth_provider = krb5
krb5_realm = REALM1
krb5_validate = false
krb5_server = kdc2address
[pam]
offline_credentials_expiration = 1
pam_cert_auth = true
And my krb5.conf
[libdefaults]
default_realm = REALM1
forwardable = true
proxiable = true
[realms]
REALM2 = {
kdc = kdc1address
admin_server = kdc1address
}
REALM1 = {
kdc = kdc2address
admin_server = kdc2address
}
[domain_realm]
.realm2 = REALM2
realm2 = REALM2
.realm1 = REALM1
realm1 = REALM1
One solution is to set pam_sss "domains" option to restrict to a single domain, then add an identical line for the second domain.
auth sufficient pam_sss.so domains=REALM1 forward_pass
auth sufficient pam_sss.so domains=REALM2 forward_pass
This works on newer systems, but not on 18. I think my version of sssd (1.16.1) is too old. As a workaround, switching to pam_krb5 does work.
However, the domains setting in sssd.conf seems like it's specifically designed to check multiple domains, so I don't understand why it doesn't work.