Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been searching on google for a while to find out the best way to synchronize the user database between OpenLDAP and an ActiveDirectory, but with not a clear results !

What i want to achieve is, have user database in OpenLDAP and then populate them into AD so these users can access all my applications(email, vpn, file server, print server almost all the opensource apps).. Basically what I am trying to do is to create a single SignOn DB so all users can have the same passwords for windows and linux based apps, but also I want to make sure the passwords are updated bidirectionally.

I will appreciate if anyone can share his experience on how this can be done. Thank you!!

share|improve this question
Is there any particular reason you can't just use the LDAP server built into AD? –  Scott Pack Mar 19 '13 at 17:42
@ScottPack Likely the driver behind this is schema differences. The common OSS schema would have to be imported into AD and that scares some people. –  sysadmin1138 Mar 19 '13 at 18:27
@sysadmin1138: It's possible. Stills seems like it might be easier to attempt to use the existing structure rather than hand roll an MDM. –  Scott Pack Mar 19 '13 at 19:07
@ScottPack Thanks for answering, sysadmin1138 it's exactly the reason for which I need to synchronise OpenLDAP with AD, and the second reason is that I have already the data into the OpenLDAP and I need to replicate it in the first time into AD and then put in place a mutual synchronisation between these two directories –  Bouanani Meher Mar 20 '13 at 13:51

1 Answer 1

up vote 0 down vote accepted

What will work for one-way sync, but with quite a bit of "some assembly required", is:

OpenLDAP → OpenLDAP replica → ActiveDirectory

where the intermediate OpenLDAP replica uses a perl backend -- rather than persistent storage. You must write a perl module which provides 9 (last time I checked) functions which map onto the LDAP API calls (bind, search, compare, modify, add etc.).

Within this code you can do whatever attribute/objectclass and name mapping might be required. There is sample configuration and code in the source distribution (SampleLDAP.pm). Estimate 1000-1500 lines of code for robust real world implementation.

A slightly simpler approach is to poll the source directory for modified objects, and push the changes, see the lsc project for an implementation. This approach may have latency and scalability concerns. With a polling method you can cheat a little with OpenLDAP searching by adding the syncrepl controls, and this gets you a simpler version of the back-perl approach -- the advantage being you don't have to implement the API, you just need to process search results which are pushed to you as changes occur, and propagate them (and save state/reconnect on error).

You will have to think hard about password handling, password attributes (userPassword, unicodePwd) are effectively magic. I've always been able to talk people out of bidirectional password synchronisation, so I can only offer basic advice there (unless I can talk you out of it too ;-)

The usual approach is to capture password changes under the guise of "complexity checking", create the password hash/format as required and propagate those values, see PasswdHk.

You might be able to "convince" your users to use an alternate method of password change/reset, and that can propagate changes, something like Self Service Password (this only sets passwords in one place though).

Red Hat have some useful documentation (though the underlying DS is no longer OpenLDAP) much of the theory still applies. AFAICT the current versions haven't made it into CentOS 6 yet.

PCNS is the Microsoft way, I believe it can push passwords to OpenLDAP (but does not do the reverse itself). XMA claims to do both, though I have not used it.

See also: Active Directory and OpenLDAP synchronization it covers a hybrid approach using Kerberos which eliminates the password synchronisation (though this makes AD authoritative for authentication).

In short, start by reading the lsc documentation, it might just do what you want.

share|improve this answer
Thanks a lot for your answer that's exactly what i was searching for :) –  Bouanani Meher Mar 21 '13 at 9:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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