Package: libpam-sss Version: 2.10.1-2+deb13u1 Severity: important Tags: patch X-Debbugs-Cc: [email protected]
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

