pam_sss_gss fails to work when KRB5CCNAME is not set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sssd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Committed
|
Medium
|
Matthew Ruffell |
Bug Description
[Impact]
If you don't set KRB5CCNAME for the current user on login, pam_sss_gss fails to
authenticate:
$ unset KRB5CCNAME
$ klist
Ticket cache: FILE:/run/
Default principal: NETWORKUSER@REALM
[valid creds listed here]
$ sudo -i
pam_sss_gss: sss_cli_getenv() call failed [2]: No such file or directory
pam_sss_gss: User not found
Please insert smart card
Please (re)insert (different) Smartcard
Please (re)insert (different) Smartcard
sudo: a password is required
A workaround is to set KRB5CCNAME before you call pam_sss_gss.
[Testcase]
You need a full AD Domain Controller set up, that uses kerberos and ldap.
From there, join the domain on the client.
Setup pam_sss_gss:
$ sudo vim /etc/sssd/sssd.conf
...
[domain/
...
pam_gssapi_services = sudo, sudo-i
auth sufficient pam_sss_gss.so needs to be the first line in the following:
$ sudo vim /etc/pam.d/sudo
auth sufficient pam_sss_gss.so
...
@include common-auth
...
$ sudo vim /etc/pam.d/sudo-i
auth sufficient pam_sss_gss.so
...
@include common-auth
...
Reboot, log back in.
You can either configure to not set KRB5CCNAME on login, or just unset it:
$ kinit <email address hidden>
$ klist
Ticket cache: FILE:/tmp/
Default principal: <email address hidden>
Valid starting Expires Service principal
03/20/25 22:49:12 03/21/25 08:49:12 <email address hidden>
renew until 03/21/25 22:49:09
$ unset KRB5CCNAME
$ sudo -i
pam_sss_gss: sss_cli_getenv() call failed [2]: No such file or directory
pam_sss_gss: User not found
Please insert smart card
Please (re)insert (different) Smartcard
Please (re)insert (different) Smartcard
sudo: a password is required
Test packages are available in the following ppa:
https:/
If you install them, you should be able to authenticate as expected.
[Where problems can occur]
This change only affects users of the pam_sss_gss module. If users are not using
this module, there is no change in functionality.
If a regression were to occur, it would affect users trying to authenticate with
pam_sss_gss. Users might be able to workaround and use a different method / pam
module to authenticate if there was a regression.
[Other info]
Upstream issue: https:/
This was fixed in 2.8.0 by the commit:
commit 9aad30711a5928f
From: Pavel Březina <email address hidden>
Date: Mon, 23 May 2022 11:05:01 +0200
Subject: pam_sss_gss: KRB5CCNAME may be NULL
Link: https:/
Only jammy needs this patch.
description: | updated |
Attached is a debdiff for jammy which solves this issue.