Implementing an OpenLDAP Server on Ubuntu

Published by admin. 18. August 2020 No Comments

Goal of this article is to show how to implement an OpenLDAP server on, Ubuntu, manage it and use it with Windows clients.

  1. Run
sudo apt-get update
sudo apt-get install slapd ldap-utils

To install OpenLDAP

2. Run

sudo dpkg-reconfigure slapd

Answer the questions like that:

  • Omit OpenLDAP server configuration? No
  • DNS domain name: Follow the pattern “domain.com”
  • Organization name: Whatever you want
  • Administrator password: Whatever you want
  • Database backend? HDB
  • Remove database when slaps is purged: No
  • Move old database: No
  • Allow LDAPv2 protocol: No

3. Run

sudo apt-get install phpldapadmin

to install phpldapadmin

4. Do the following adjustments:

nano /etc/phpldapadmin/config.php

Search (ctrl+w) for “$servers->setValue” and replace ‘localhost’ in

$servers->setValue('server','host','localhost');

with the servers IP address. Replace “dc=example,dc=com” with your previously chosen domain name. E. g. “dc=domain,dc=com”

$servers->setValue('server','base',array('dc=example,dc=com'));

Do the same to this line:

$servers->setValue('login','bind_id','cn=admin,dc=example,dc=com');

Uncomment this line:

$config->custom->appearance['hide_template_warning'] = false;

And replace false with true

Done.

Now you can open the web client, typing <ipaddress>/phpldapadmin in your browser. Should there be a prompt to type in a username and password, before she actual webpage opens, type “admin” and the previously set password. If the webpage opens, log in using the string “cn=admin,dc=domain,dc=com”, replacing the dc part with the domain your previously chose.

Leave a Reply

Your email address will not be published. Required fields are marked *