utils/sssd: set pwfield=x in local() to fix pam_unix auth with proxy domain - #265
Open
mmatsuya wants to merge 1 commit into
Open
utils/sssd: set pwfield=x in local() to fix pam_unix auth with proxy domain#265mmatsuya wants to merge 1 commit into
mmatsuya wants to merge 1 commit into
Conversation
…domain When id_provider=proxy with proxy_lib_name=files is used with proxy_pam_target other than sssd-shadowutils, SSSD returns '*' in the password field by default (SSSD issue #5129). This causes pam_unix to treat the account as locked, breaking SSH and su authentication for local users when 'sss' appears before 'files' in /etc/nsswitch.conf. Explicitly setting pwfield=x ensures pam_unix reads the actual password hash from /etc/shadow, regardless of the nsswitch.conf ordering. Signed-off-by: Masahiro Matsuya <mmatsuya@redhat.com>
Contributor
Author
|
Closing this PR — The intent was to keep the password field as This was confirmed by running an automated test (Jenkins job #15471) which showed 2 failed, 0 passed due to the invalid config option. The correct fix needs a different approach, such as adjusting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SSSDCommonConfiguration.local()configures SSSD withid_provider=proxyandproxy_lib_name=files, which is the standard setup for tests that need localusers (e.g. KCM tests via
client.sssd.common.kcm()).When
sssappears beforefilesin/etc/nsswitch.conf— which is the defaulton many RHEL images — and SSSD is using the proxy+files domain with
proxy_pam_target=system-auth, SSH and su authentication for local users fails:This was observed in the upstream SSSD test
test_kcm__ccache_holds_multiple_and_all_types_of_principalsrunning on RHEL 9.6, where the test consistently fails with
SSHAuthenticationErrorwhen the client image ships withpasswd: sss files systemd.Root Cause
When
proxy_lib_name=filesis combined with aproxy_pam_targetother thansssd-shadowutils, SSSD returns*in the password field for NSS lookupsinstead of
x. This is a known SSSD behavior documented inSSSD issue #5129.
The sequence of events:
getent passwd tuser(via NSS withpasswd: sss files) → SSSD proxy returnstuser:*:1001:...pam_unixsees*in the password field → treats account as locked/etc/passwdand/etc/shadowThe fix in SSSD 2.3.0 (
ae5a2cd) setpwfield=xautomatically for proxy+files, but SSSD 2.3.1 scoped that back to onlyapply when
proxy_pam_target=sssd-shadowutils. Sincelocal()usesproxy_pam_target=system-auth, the*behavior persists in current SSSD versions.Fix
Explicitly set
pwfield=xin the domain configuration. This ensurespam_unixreceives
xin the password field and correctly falls back to/etc/shadowforauthentication, regardless of the
nsswitch.confordering.Testing
Verified on RHEL 9.6 (
sssd-2.9.4) withpasswd: sss files systemdin/etc/nsswitch.conf:test_kcm__ccache_holds_multiple_and_all_types_of_principalsfails withSSHAuthenticationErrorpwfield=x): authentication succeeds, test passes