Installing and configuring slapd
We are going to use OpenLDAP(slapd) to build a LDAP database accessible for the security module WITHOUT simulating an Active Directory. This tutorial will create an LDAP server and a single user for access.
Image 01: Installing slapd.
In a Debian-based system, we need to use apt-get to retrieve and install slapd.
After the installation, we must configure the settings for the slapd. To do so, we must use dpkg-reconfigure to build.
Select the "No" option and press Enter to continue.
Choose your domain name.
Type the organization name and press Enter to continue.
Define the admin password and press Enter to confirm it.
Adding a new user
First of all, you must create a LDIF file with the info about the user on it:
user@computer:~$ touch hbarros.ldif
This is the content we are using for this sample file:
# Object 1: uid=hbarros,dc=lpessoa,dc=scriptcase,dc=info dn: uid=hbarros,dc=lpessoa,dc=scriptcase,dc=info objectclass: account objectclass: simpleSecurityObject objectclass: top uid: hbarros userpassword: {MD5}6jAUXhUfuutm7cbFC6oVUA== |
Now we are ready to put it on the database itself.
Get admin rights:
user@computer:~$ su
Stop the lapd service:
root@computer:/home/user# /etc/init.d/sladp stop
Use slapadd to import the file:
root@computer:/home/user# slapadd -l /home/user/hbarros.ldif
Restart the service.
root@computer:/home/user# /etc/init.d/slapd start
Results
This tutorial created a LDAP authentication environment. The authentication data for this example are:
Domain | LPESSOA |
DN | DC=lpessoa,DC=scriptcase,DC=info |
User Name | UID=hbarros,DC=scriptcase,DC=info |