[Samba] KRB5 pam_winbind using KEYRING does not work

Rowland Penny rpenny at samba.org
Tue Oct 28 10:45:55 UTC 2025


On Tue, 28 Oct 2025 00:23:30 +0100
Rainer Meier via samba <samba at lists.samba.org> wrote:

> Hello Samba experts
> 
> I am having issues or misunderstanding how to use pam_winbind
> Kerberos storing caches in keyring.
> 
> However performing "klist" after login returning:
> 
> klist: Credentials cache keyring 'persistent:<UID>:<UID>' not found.
> 
> 
> And during logout I see this in the debug log of pam_winbind:
> 
> username [testuser] obtained
> user has no KRB5CCNAME environment
> request wbcLogoffUser succeeded
> user 'testuser' OK
> 
> 
> So either I am missing someting or pam_winbind does not set
> KRB5CCNAME environment variable properly (I checked, it's not set).
> Using pam_krb5 it is set but as of my understanding I don't need
> pam_krb5 in addition to pam_winbind. Or I should not need it.
> 
> To me it looks like pam_winbind is not properly adding the caches to 
> keyring and not setting the KRB5CCNAME variable. Therefore also
> krenew is not working.
> 

I run Debian as standard, so normally the kerberos cache goes into /tmp
and just works, but it should work.

I don't have Samba running on Arch, the nearest I have is a Rocky Linux
10 VM running as a DC, so I set that up using your
/etc/security/pam_winbind.conf settings and added 'default_ccache_name
= KEYRING:persistent:%{uid}' to the '[libdefaults]' section of the
/etc/krb5.conf file.

I logged in and ran this: echo "$KRB5CCNAME"

Which returned this:

KEYRING:persistent:3000016

So I ran 'klist', which returned this:

Ticket cache: KEYRING:persistent:3000016:3000016
Default principal: rowland at AD.HOME.ARPA

Valid starting     Expires            Service principal
28/10/25 10:07:05  28/10/25 20:07:05  RL10$@AD.HOME.ARPA
	renew until 04/11/25 10:07:05
28/10/25 10:07:05  28/10/25 20:07:05  krbtgt/AD.HOME.ARPA at AD.HOME.ARPA
	renew until 04/11/25 10:07:05

I then altered /etc/krb5.conf to add some of your other settings:

[libdefaults]
        default_realm = AD.HOME.ARPA
        dns_lookup_realm = false
        dns_lookup_kdc = true
        default_ccache_name = KEYRING:persistent:%{uid}

[realms]
AD.HOME.ARPA = {
        default_domain = ad.home.arpa
        ticket_lifetime = 7d
        renew_lifetime = 14d
        forwardable = true
        proxiable = false
        minimum_uid = 1
}

[domain_realm]
        rl10 = AD.HOME.ARPA

And logged out and in again, it still worked, try my /etc/krb5.conf
(altered to your REALM etc).

Rowland




More information about the samba mailing list