Might this help?

http://www.imaginator.com/~simon/ldap/

add user information to your LDAP database
To use LDAP authentication we need to add all employees to a database. The best source 
for this kind of thing is your /etc/passwd, /etc/group and /etc/shadow files. There 
are some good little migration tools that turn this: 
cat /etc/passwd
...
simon:rF4x4xNEP1bA.:1000:1000:Simon Tenant,Fish-bowl,x 245,:/home/simon:/usr/bin/zsh
...

into something like this 
dn: uid=simon,ou=People,dc=linuxcare,dc=com
uid: simon
cn: Simon Tennant
objectClass: account
objectClass: posixAccount
objectClass: top
userPassword: {crypt}rF4x4xNEP1bA.
loginShell: /usr/bin/zsh
uidNumber: 1000
gidNumber: 1000
homeDirectory: /home/simon
gecos: Simon Tennant,Fishbowl,x 245

The magic is avaliable at: http://www.padl.com/download/MigrationTools.tgz. There are 
a couple of scripts in the tarball. The important one is: migrate_passwd.pl which 
sucks in your /etc/passwd and spits out LDAP entries in an ldif format. 
This script knows how to deal with shadow passwords but it'll need to be able to read 
/etc/shadow so run it as root if you're using shadow passwords. 

Using your favorite LDAP server you should now load these entries into the LDAP 
database. For openldap you'd run: 

/etc/init.d/openldapd stop
ldif2ldbm  -i /tmp/converted_passwd.out -f /etc/openldap/slapd.conf 
/etc/init.d/openldapd start

and then check that the entries made it in: 
ldapsearch -b dc=linuxcare,dc=com objectclass=posixaccount

This query is similar to the query that the ldap modules will run, so if you don't get 
any output now, best go back and check. Also check that you have used a consistent 
base(dc=...,dc=...). 

Fred Bbaale <[EMAIL PROTECTED]> wrote:

>
>Does anyone know of an easy way to convert my passwd users to ldap ?
>
>F.
>
>
>
>
>---------------------------------------------
>This service is hosted on the Infocom network
>http://www.infocom.co.ug
>

__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


---------------------------------------------
This service is hosted on the Infocom network
http://www.infocom.co.ug

Reply via email to