I'm configuring a system in which all IT resources are available through a single user-password pair, be it access to shell on the servers, logging to Samba domain, WiFi, OpenVPN, Mantis, etc. (with access to specific services governed by group membership or user object fields). Because we have personal data in our network, we need to implement password aging, as per the EU Data Protection Directive (or rather the Polish version of it).
The problem is that Samba and POSIX accounts in LDAP use different password hashing and aging information. While synchronizing the passwords themselves is easy (the ldap password sync = Yes
in smb.conf
), adding password aging to the mix breaks things: Samba doesn't update shadowLastChange. Together with obey pam restrictions = Yes
creates a system in which a windows user can't change aged password, but if I don't use it, home directories won't be automatically created. The alternative is to use use LDAP extended operation for password changing, but the smbk5pwd
module doesn't set it either. What's worse, the OpenLDAP maintainer won't update it/accept patches as this field is considered deprecated.
So, my question is, what is the best solution? What are the up- and downsides of them?
Use LDAP
ppolicy
and internal LDAP password aging?- How well does it work with NSS, PAM modules, samba, other systems?
- Do the NSS and PAM modules need to be configured in special way to use ppolicy, not shadow?
- Does GOsa² work with ppolicy?
- Are there other administrative tools that can work with
ppolicy
-enabled LDAP?
Hack together a change password script that updates the field in LDAP. (leaving the possibility that the user himself will update the field without changing password)
As a stop-gap I created script for Samba that will update the
shadowLastChange
on password change:In Samba config it needs
unix password sync
set toyes
,passwd chat
set to*OK*
andpasswd program
to above script with"%u"
as param.An account specified in
LDAP_USER
needs to be created in LDAP and given permissions to read onuid
of all Samba users and the right to writeshadowLastChange
.I wrote my own OpenLDAP overlay called
shadowlastchange
to update theshadowLastChange
attribute whenever an EXOP password change occurs. It is activated inslapd.conf
:I have configured
smb.conf
to change passwords via EXOP:Then, for each account, set
shadowMax
to the number of days a password is valid. The OpenLDAP modules take care of the rest!(work in progress, I'll add details later)
Good news everyone! I got the whole thing working, more or less..., in a testing environment...:
ppolicy
,not24get
andpasswdqc
)smbk5pwd
). Note: Quality checking with Samba and ppolicy is non obvious: thepassword check script
(pwqcheck -1
frompasswdqc
) needs to perform the same checks the LDAP does or the user will get a Permission Denied instead of "Too easy password, try different".pam_mkhomedir
uid
to group entries, so applications expecting either NIS (most of "UNIXy" stuff) or RFC2307bis schema (most of "designed for AD" applications) work just fine.The only problem is that disabling an account requires use of CLI tools (or writing GOsa postmodify script) or the account won't be locked at LDAP level, just for PAM and Samba. The password expiration will still be enforced, so it's not a big problem.
I've got answer from one of the GOsa developers. At this time GOsa does not support ppolicy overlay in any way.