LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Getting access denied when "user must change password at next logon" is checked . (https://www.linuxquestions.org/questions/linux-security-4/getting-access-denied-when-user-must-change-password-at-next-logon-is-checked-865722/)

tom345 03-01-2011 07:53 AM

Getting access denied when "user must change password at next logon" is checked .
 
I have got a RHEL 5.6 server configured to authenticate via a Windows 2008 domain controller via LDAPS. Everything is working fine, except from the following:

When I create a new user in Active directory and check the option "user must change password at next logon", the new user cannot logon and gets an "access denied" message.

In /var/log/secure, I find the following:

Mar 1 14:43:21 cpssvn10 sshd[5363]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.3.12 user=testuser2
Mar 1 14:43:21 cpssvn10 sshd[5363]: pam_ldap: error trying to bind as user "CN=CPSS Testuser 2,OU=IBM,DC=cpss,DC=smarterplatform,DC=com" (Invalid credentials)
Mar 1 14:43:23 cpssvn10 sshd[5363]: Failed password for testuser2 from 192.168.3.12 port 4583 ssh2

As soon as I uncheck the "user must change ..." option, the user can log on without problems. Also password change via the passwd command works.

The security guidelines of my company require that a new user must change his password. What can I do?

Reuti 03-02-2011 04:41 AM

Does pam know that it must contact the ldap-server to change the password (at time of login, later on it’s working obviously)? This can be in the module auth in pam, while changing it later would be in module password (where it’s working).

tom345 03-02-2011 05:12 AM

Thanks for your reply. This is my system-auth file:

#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth sufficient pam_ldap.so use_first_pass
auth required pam_deny.so

account required pam_unix.so broken_shadow
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account [default=bad success=ok user_unknown=ignore] pam_ldap.so
account required pam_permit.so

password requisite pam_cracklib.so try_first_pass retry=3
password sufficient pam_unix.so remember=7 md5 shadow nullok try_first_pass use_authtok
password sufficient pam_ldap.so use_authtok
password required pam_deny.so

session optional pam_keyinit.so revoke
session required pam_limits.so
session optional pam_mkhomedir.so umask=0077
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so
session optional pam_ldap.so

I would not know, how to tell pam that it must contact ldap for password change. I am not a pam specialist at all. I have tried to append use_authtok to the line "auth sufficient pam_ldap.so use_first_pass", but it did not help.


All times are GMT -5. The time now is 05:05 AM.