I am trying to find how to change some password policy settings in OpenLDAP (on a system-wide level, not on a per user level) such that all LDAP account users (i.e., existing and new users) have their passwords to expire after 90 days.

I know the main parameter that controls this is the maxPasswdAge parameter but I am not sure how to set this. I have tried different ldapmodify options but it fails:

ldapmodify -W -x -D "cn=Manager,dc=mydomain,dc=local" -f test.ldif 

dn: cn=pwdpolicyentry,cn=common,cn=products,cn=OracleContext,o=my_company,dc=com
changetype: modify
replace: pwdMaxAge
pwdMaxAge: 7776000

The error message was ..

modifying entry "cn=pwdpoilicyentry,cn=common,cn=products,cn=Oraclecontext,dc=mydomain,dc=com"
ldapmodify :no such object(32)

matched DN: dc=mydomain,dc=com 

My questions are

Are there any alternatives to doing this, for example: just change a setting manually somewhere in some configuration file and restart the LDAP server.

Are there any services that need to be bounced once this is done?

  • 1
    How is the system using LDAP to pull this information? Is pam-ldap or nss-ldap being used? – Tim Jan 13 '12 at 14:42

It looks like you may be missing entries in the tree to the policy entry.

You will need to load the slapo-ppolicy overlay. The man page for the module specifies what you need to setup. I find the Ztrax documentation useful as well.

  • Thanks for your help but i think i already have slapo-overlay, any other thoughts please – Dominiqs Feb 21 '12 at 18:24

The tool to achieve what you need is ppolicy.

This a multi-step task involving:

  1. a module add;
  2. a schema add;
  3. a overlay add to a given database (it also defines which policy entry is the default policy);
  4. one or more entry adds which define the password policies (one can be the default policy).

In the entry defined at step 4 you can modify the pwdMaxAge attribute.


Your "user" entry in the LDAP directory needs to have 2 attributes:

passwordExp: on
passwordMaxAge: 8640000

8640000 = 100 days.

  • Tim Thanks very much but how do you change these attributes , what command will you use exactly – Dominiqs Jan 17 '12 at 15:00
  • Tim, still havent found out how to do this , i have had no solution or reply , any more suggestions .How do i set these attributes please – Dominiqs Mar 13 '12 at 10:21
  • which directory or config file are we talking about openldap.conf – Dominiqs Mar 23 '12 at 14:30
  • It's not OpenLDAP related. Maybe it's a setting found on: Sun ONE Directory Server – 473183469 Nov 10 '15 at 11:08
  • Tim, the question is about OpenLDAP: these are not valid OpenLDAP attributes. – user207421 Dec 5 '16 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.