Ubuntu's source contains OpenLDAP, but does not call this name, execute the following command to install $ sudoapt-getinstallslapdldap-utilsdb4.6-util2. create the root user password $ slappasswd enter the password twice according to the on-screen prompt and an encrypted string will be obtained $ ldapadd-x-v-f ~ /Source/ldap/OpenLDAP/ldf/admin. ldi
The Ubuntu source contains OpenLDAP, but it is not called. You can run the following command to install
$ Sudo apt-get install slapd ldap-utils db4.6-util
2. Create the root user password
$ Slappasswd
Enter the password twice as prompted and an encrypted string is displayed.
$ Ldapadd-x-v-f ~ /Source/ldap/OpenLDAP/ldf/admin. ldif
3. Set ldap Information
Edit the/etc/ldap/slapd. conf file. modify some information as follows:
Suffix "dc = jimhome, dc = com"
Directory "/var/lib/ldap"
Rootdn "cn = admin, dc = jimhome, dc = com"
Rootpw {SSHA} HldmdEL0M8EGT1wHM1XOXmAbtBe3CzXx
Access to attrs = userPassword, shadowLastChange
By dn = "cn = admin, dc = jimhome, dc = com" write
By anonymous auth
By self write
By * none
Access *
By dn = "cn = admin, dc = jimhome, dc = com" write
By * read
3. Restart the LDAP daemon.
$ Sudo/etc/init. d/slapd restart
4. Import the root user ldif File
Create a file and use the nano command.
$ Nano admin. ldif
Enter the following information:
Dn: dc = jimhome, dc = com
ObjectClass: dcObject
ObjectClass: organization
Dc: jimhome
O: jim 'home pc
Note: the format of the ldif file is very strict. It cannot be a space error. It is abnormal.
5. Import the ldif File
$ Ldapadd-x-v-f ~ /Source/ldap/OpenLDAP/ldf/admin. ldif
Note that the path must be an absolute path; otherwise, ldafadd fails to be imported.
If you think the command line is troublesome, you can use tools to import it. For example, apache directory studio is good because it is based on eclipse and has cross-platform features.