🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #5658

Bug#1154932: Login via Freeipa OTP not working because of wrong pam configuration

#5658
From: Darina Orgaeva
Date: Mon, 23 Nov 2026 01:20
108 lines
5511 bytes
Package: libpam-sss
Version: 2.10.1-2+deb13u1
Severity: important
Tags: patch
X-Debbugs-Cc: darina.orgaeva@gmail.com

I encountered the problem that I am unable to autheticate with 2FA in Freeipa (with OTP)
There was already created bug with my problem but it was ignored: #1001644

Brief description:
common-auth have structure like:
```
auth	[success=2 default=ignore]	pam_unix.so nullok
auth	[success=1 default=ignore]	pam_sss.so use_first_pass
```

So, since pam_sss has use_first_pass flag, it takes the authtok from pam_unix not asking second factor
Red Had suggested to use their pam architecture (instead of implementation of support of try_first_pass option for pam_sss.so):
Have additional pam_module that redirects the user depending on his local or domain authentication

https://github.com/SSSD/sssd/issues/6946#issuecomment-1729283975

Debian has the module: pam_localuser.so

So, when sss is configured for pam, we should have pam_localuser.so on the top, so it can manage user direction and user is always prompted with needed pam modules.

I suggest making following changes to pam-auth-update profiles:

```
diff --git a/debian/libpam-sss-skip-local-user.pam-auth-update b/debian/libpam-sss-skip-local-user.pam-auth-update
new file mode 100644
index 000000000..54de153c9
--- /dev/null
+++ b/debian/libpam-sss-skip-local-user.pam-auth-update
@@ -0,0 +1,6 @@
+Name: Skip local user (for enabling 2FA sssd)
+Default: yes
+Priority: 512
+Auth-Type: Primary
+Auth:
+	[success=ignore default=1]	pam_localuser.so
diff --git a/debian/libpam-sss.pam-auth-update b/debian/libpam-sss.pam-auth-update
index 22e3e24c5..19af4cb24 100644
--- a/debian/libpam-sss.pam-auth-update
+++ b/debian/libpam-sss.pam-auth-update
@@ -4,7 +4,7 @@ Priority: 128
 
 Auth-Type: Primary
 Auth:
-	[success=end default=ignore]	pam_sss.so use_first_pass
+	[success=end default=ignore]	pam_sss.so try_first_pass
 Auth-Initial:
 	[success=end default=ignore]	pam_sss.so forward_pass
 Account-Type: Additional
diff --git a/debian/libpam-sss.prerm b/debian/libpam-sss.prerm
index 19e23fa36..82eb99695 100644
--- a/debian/libpam-sss.prerm
+++ b/debian/libpam-sss.prerm
@@ -4,6 +4,7 @@
 if [ "$1" = remove ] && [ "${DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT:-1}" = 1 ]; then
     pam-auth-update --package --remove \
         sss \
+	skip-local-user \
         sss-smart-card-optional \
         sss-smart-card-required
 fi
diff --git a/debian/rules b/debian/rules
index 93f10f06f..265e518a2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -74,6 +74,8 @@ override_dh_install:
 	mkdir -p $(CURDIR)/debian/libpam-sss/usr/share/pam-configs
 	install -m644 debian/libpam-sss.pam-auth-update \
 		$(CURDIR)/debian/libpam-sss/usr/share/pam-configs/sss
+	install -m644 debian/libpam-sss-skip-local-user.pam-auth-update \
+                $(CURDIR)/debian/libpam-sss/usr/share/pam-configs/skip-local-user
 	install -m644 debian/libpam-sss-smart-card-optional.pam-auth-update \
 		$(CURDIR)/debian/libpam-sss/usr/share/pam-configs/sss-smart-card-optional
 	install -m644 debian/libpam-sss-smart-card-required.pam-auth-update \

```


-- System Information:
Debian Release: 13.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.90+deb13.1-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libpam-sss depends on:
ii  libc6             2.41-12+deb13u3
ii  libgssapi-krb5-2  1.21.3-5+deb13u2
ii  libpam-pwquality  1.4.5-5
ii  libpam-runtime    1.7.0-5
ii  libpam0g          1.7.0-5

Versions of packages libpam-sss recommends:
ii  sssd  2.10.1-2+deb13u1

libpam-sss suggests no packages.

-- no debconf information
Technical Details
Message-ID: <O2qSS-dzAG-9@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Darina Orgaeva <darina.orgaeva@gmail.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1154932: Login via Freeipa OTP not working because of wrong pam configuration
Date: Mon, 23 Nov 2026 02:20:02 +0100
Message-ID: <O2qSS-dzAG-9@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Nov 23 01:13:07 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: 3.916
Reply-To: Darina Orgaeva <darina.orgaeva@gmail.com>, 1154932@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: darina.orgaeva@gmail.com, sssd@packages.debian.org
X-Debian-Pr-Message: report 1154932
X-Debian-Pr-Package: libpam-sss
X-Debian-Pr-Keywords: patch
X-Debian-Pr-Source: sssd
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 13.2.0
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2004296
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 108
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 23 Nov 2026 04:10:22 +0300
X-Original-Message-ID: <179539622260.4205.18103215542265524722.reportbug@debian13.ipartkn.test>