Last version : 0.1 02/ 2005


Ldap2Unix is a very simple LDAP to paswd/shadow/group synchroniser.

If you need to authenticate LDAP users to access applications on a UNIX host, then you have two solutions :
1) configure the operating system and/or every local application to lookup the LDAP directory,
2) synchronise local flat-files-directory (/etc/passwd , shadow , group files) with the LDAP directory.

The second solution has no impact on local application's configuration. It allows a simple and clean rollback if needed. This is the goal of Ldap2Unix.

The ldap2unix.pl script may be launched by a schedulled job (cron). It will synchronise local accounts with LDAP accounts.


ldap2unix.pl -vhlpbasgd [option]

Options :

-v : prints current version
-h : prints help
-l : ldap server (default:
-p : ldap bind port (default: 389)
-b : base DN (default: dc=darkstar,dc=net)
-a : ldap admin CN (default: cn=admin)
-s : admin pw (default: secret)
-g : group name prefix for ldap users (default: ldapusers)
-d : turn on debug output

Example :

To synchronise :

Command line should be :

ldap2unix.pl \
-l \
-b dc=darkstar,dc=net \
-a cn=admin \
-s skywalker


Location :

Ldap2Unix can be downloaded HERE.

Ldap2Unix needs the following perl modules (included in install tarball) :

perl-ldap - http://search.cpan.org/~gbarr/perl-ldap-0.3202/
List-Compare - http://search.cpan.org/~jkeenan/List-Compare-0.31/

Install :

Just unpack and run "make" in the "ldap2unix" directory
("make uninstall" to uninstall ;))


Jean-Philippe Guillemin - jpgu~AT~users.sourceforge.net


Copyright Jean-Philippe Guillemin.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Please take a look at http://www.gnu.org/copyleft/gpl.html