Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] OpenLDAP, PAM, and the passwd command
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
crouchingturbo
n00b
n00b


Joined: 27 Apr 2004
Posts: 11
Location: Rhode Island

PostPosted: Sun Dec 31, 2006 3:49 pm    Post subject: [Solved] OpenLDAP, PAM, and the passwd command Reply with quote

My OpenLDAP setup is almost complete. I setup OpenLDAP and PAM following the (not so great) Gentoo Guide. Currently, users can login and authenticate with their LDAP password. However, when a user runs the "passwd" command, it goes one of two ways:

Code:
$ passwd
(current) UNIX password: <correct user password here>
New UNIX password: <a new password>
Retype new UNIX password: <a new password>
passwd: password updated successfully


In this situation, the LDAP password is never updated, but the one in /etc/shadow is updated. The second scenario:

Code:
$ passwd
(current) UNIX password: <*incorrect* password here>
Enter login(LDAP) password:
New UNIX password:
Retype new UNIX password:
LDAP password information changed for user
passwd: password updated successfully


In this situation, the LDAP password gets updated, but the one in /etc/shadow is not updated.

I can't figure out how to make the passwd command update both passwords simultaneously.

Here is my /etc/pam.d/system-auth:
Code:
#%PAM-1.0

auth       required     pam_env.so
auth       sufficient   pam_unix.so likeauth nullok
auth       sufficient   pam_ldap.so use_first_pass
auth       required     pam_deny.so

account    required     pam_unix.so
account    sufficient pam_localuser.so
account    required pam_ldap.so

password   required     pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
password   sufficient pam_unix.so nullok md5 shadow use_authtok
password   sufficient pam_ldap.so use_authtok
password   required     pam_deny.so

session    required     pam_limits.so
session    required     pam_unix.so
session    optional pam_ldap.so


If I put "use_first_pass" on the password sufficient pam_ldap.so line, as the Guide recommends, then I can only change my UNIX password, never the LDAP one.


Last edited by crouchingturbo on Mon Jan 01, 2007 11:58 am; edited 2 times in total
Back to top
View user's profile Send private message
crouchingturbo
n00b
n00b


Joined: 27 Apr 2004
Posts: 11
Location: Rhode Island

PostPosted: Mon Jan 01, 2007 11:53 am    Post subject: Reply with quote

Figured it out... The Gentoo guide is wrong -- it's not "use_first_pass", it's "try_first_pass".

Edit: After more searching, seems like both use_first_pass and try_first_pass are valid options. I have no idea why it wasn't working before, but things are working fine now. Here's my new, not too different, config:

Code:
#%PAM-1.0

auth     required   pam_env.so
auth     sufficient pam_ldap.so
auth     sufficient pam_unix.so likeauth nullok try_first_pass
auth     required   pam_deny.so

account  sufficient pam_ldap.so
account  required   pam_unix.so try_first_pass

password requisite  pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
password sufficient pam_ldap.so use_authtok
password sufficient pam_unix.so nullok md5 shadow use_authtok try_first_pass
password required   pam_deny.so

session  required   pam_limits.so
session  sufficient pam_ldap.so
session  sufficient pam_unix.so try_first_pass
session  required   pam_deny.so
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum