166 The Virtualization Cookbook for Red Hat Enterprise Linux 5.2
rootdn "cn=ldaproot,dc=itso,dc=ibm,dc=com"
...
Set the rootpw line to a value of the encrypted password that was the output of the
slappasswd command:
...
# rootpw secret
# rootpw {crypt}ijFYNcSNctBYg
rootpw {SSHA}4FiGwLm+cy+I96TyiWMn4evNXSXa5aJ2
...
Save the slapd.conf file. Your LDAP server should now be minimally configured.
Start the LDAP service
Start LDAP at boot time using the chkconfig command and, for this session, using the
service command:
# chkconfig ldap on
# service ldap start
Checking configuration files for slapd: config file testing succeeded [ OK ]
Starting slapd: [ OK ]
Query the LDAP database using the ldapsearch command. The -x flag specifies that simple
authentication is used:
# ldapsearch -x
# extended LDIF
#
# LDAPv3
# base <> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# search result
search: 2
result: 32 No such object
The result shows that the LDAP directory can be searched, but that it is empty. This is
expected because no data has been added to it.
12.2.4 Migrating existing users to LDAP
A common method of populating the LDAP database is using LDAP Directory Interchange
Format (LDIF) files. Red Hat includes a set of migration scripts with the OpenLDAP server
RPM, written by PADL Software Pty Ltd (
http://padl.com). These scripts allow you to convert
users and groups from the /etc/ directory to LDIF format. The scripts are in the
/usr/share/openldap/migration/ directory. Before converting the /etc/group and
/etc/passwd files, add a user that will be used to test LDAP authentication. In this example,
ldapuser1 is added using the useradd command and the password is set using the passwd
command:
# useradd ldapuser1
# passwd ldapuser1
Changing password for user ldapuser1.
New UNIX password: <lnx4vm>
Retype new UNIX password: <lnx4vm>
passwd: all authentication tokens updated successfully.
Comentarios a estos manuales