openldappassword-policy

OpenLDAP: Can I set pwdAccountLockedTime in the future?


With OpenLDAP and the ppolicy overlay, one way to disable a user account is by setting the pwdAccountLockedTime. However, is it allowed to set this value to a future date so users account automatically expires?

From the tests I ran, this looks OK with OpenLDAP 2.6, but fails sometimes with OpenLDAP 2.4. I could not read anything in the password-policy reference, nor the ppolicy overlay documentation about this being either allowed or prevented.

Related links:


Solution

  • There are some clues in the OpenLDAP mailing list:

    Since 2.5 OpenLDAP implements the pwdEndTime that can be used in that situation:

    This attribute specifies the time the entry's password becomes invalid for authentication. Authentication attempts made after this time will fail, regardless of expiration or grace settings. If this attribute does not exist, then this restriction does not apply.

    Related SO question: How to set account expiry date in openldap