Bug 1663445
| Summary: | nscd when running results in pam module getting garbage value for password - #010#012#015#177INCORRECT | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Hareesh Joshi <hareesh.joshi> |
| Component: | glibc | Assignee: | glibc team <glibc-bugzilla> |
| Status: | CLOSED NOTABUG | QA Contact: | qe-baseos-tools-bugs |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.7 | CC: | ashankar, codonell, dj, fweimer, hareesh.joshi, jkachuck, mnewsome, pfrankli |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Other | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-01-15 17:35:23 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Hareesh Joshi
2019-01-04 11:21:12 UTC
Can you reproduce this issue just with Red Hat Enterprise Linux system components? Thanks. None are non RHEL components. Should I disable the PAM implementation? Hello Hareesh, Are you able to do this on RHEL 7 or RHEL 8? Which PAM module are you implementing? Have you been able to do this previously? If you are looking for steps on how to complete this task. Please open a support case on access.redhat.com. If you are stating this is a bug. Please confirm all steps/commands entered to recreate this issue. Thank You Joe Kachuck Hi Joe, Thanks for looking into this. I'm using CentOS6.7 which is based on RHEL. I've implemented sshd pam module. I didn't have any problem with this module until I installed nscd service. I'm stating that this is a defect with nscd service which is interfering with the password read operation of pam module. I've listed the steps above on how to reproduce the issue. The following more detailed steps might help you better - 1. Implement a pam module say, pam_myapp.c which provides implementation for pam_sm_authenticate, pam_sm_acct_mgmt. 2. Deploy the module in /lib64/security as a shared object say - pam_myapp.so 3. Update the /etc/pam.d/sshd config file to include pam_myapp.so under auth, account, password and session module interfaces 4. Try to login with say, "ApplicationAdmin" as the username and password say "LetMeIn". Not that, ApplicationAdmin is not an OS user, i.e., password/shadow files have no idea about this user. At this point, pam_myapp kicks in and authenticates the user based on the username/password provided. 5. This works fine as long as the username is "ApplicationAdmin" and password in "LetMeIn". 6. If the user tries to login as say, root, pam_myapp authentication fails and then password-auth kicks in and regular sshd login continues. 7. Now install and start nscd service 8. Attempt to login as ApplicationAdmin/LetMeIn via ssh. The login fails. 9. Enabled logs in the pam module to see if username and password are passed appropriately to the pam module. I see that password passed is #010#012#015#177INCORRECT instead of LetMeIn. Hence pam_myapp fails to authenticate the user even though the user provided proper creds. If I stop nscd service or disable password caching in nscd (using /etc/nscd.conf) the password is passed appropriately to the pam module. Hello Hareesh, Are you able to recreate this issue on RHEL 7 or 8? CentOS while based on RHEL is not a Red Hat supported release. Thank You Joe Kachuckhareesh.joshi Hi Joe, Yeah, I understand you on CentOS aspect. While I haven't tried on RHEL 7 or 8, I'm hoping that glibc team would look into this issue as to why nscd is interfering with pam. (In reply to Hareesh Joshi from comment #7) > I'm hoping that glibc team would look > into this issue as to why nscd is interfering with pam. I do not think this is nscd. This OpenSSH developer list post suggests you are running into an OpenSSH issue: "Bad Password - #010#012#015#177INCORRECT : ssh -> pam -> libpam_sqlite -> sqlite3" https://lists.mindrot.org/pipermail/openssh-unix-dev/2014-March/032283.html You need an NSS service provider to provide the "Identity" information for the user. Please tell me if that helps. Yes Carlos, I did come across the link you quoted. And as I mentioned in the defect description earlier, I do have nsswitch.conf modified appropriately. Here's the excerpt - passwd: files myapp shadow: files group: files >>I do not think this is nscd. Curious to know - why does it work perfectly fine on disabling nscd service. >>You need an NSS service provider to provide the "Identity" information for the user. I think passwd deals with Identity. Should I have shadow field modified as well? Thank you for looking into this. (In reply to Hareesh Joshi from comment #9) > Yes Carlos, I did come across the link you quoted. > And as I mentioned in the defect description earlier, I do have > nsswitch.conf modified appropriately. > > Here's the excerpt - > > passwd: files myapp > shadow: files > group: files That doesn't include gid, and so fails to provide a complete identity. > >>I do not think this is nscd. > Curious to know - why does it work perfectly fine on disabling nscd > service. I don't know. You would need to do a root cause analysis. When you don't use nscd the NSS call is made by the process itself and so the credentials of the process might be used. In the case of nscd the process is isolated and hardened and so is distinct from the process requesting the information. This difference might matter. > >>You need an NSS service provider to provide the "Identity" information for the user. > I think passwd deals with Identity. Should I have shadow field modified as > well? I would expect passwd, shadow, and group all need to be handled or you will have odd behaviour from applications that are using the normative APIs to lookup user information. Given that this is not a glibc issue I'm closing this as CLOSED/NOTABUG. Thank you for submitting the bug. Please reopen if you complete a root cause analysis and find a defect in the glibc component. |