Set up your LDAP server on Ubuntu 10.04

If you need access to console ports and power control functions at remote network equipment sites, our console server products and switched PDU products feature LDAP authentication for secure, reliable remote management and control.

So lately I’ve been covering some pretty sweet LDAP tools. You’ve seen “Manage your LDAP data with phpLDAPAdmin“, “Access and manage your LDAP data with Luma“, and “Set up an LDAP server on Fedora“. Although the last entry showed you how to get a server up and running with the 389 Directory Server GUI, none of these articles have touched on the tried and true text-based installation and setup of the slapd LDAP server. And that is exactly what we are going to do here.

But here’s the thing – the slapd server can be a real pain to set up. It didn’t used to be. The old fashion way was to install slapd and then edit the /etc/ldap/slapd.conf file to suite your needs. Thing is, the slapd.conf configuration file has been¬†deprecated and now, trying to figure out how to configure slapd is like finding the proverbial needle in the proverbial haystack. Fortunately, in my desperate scouring to work out an easy method of doing this, I have found some tools to make the job easier. And that’s what this article is all about, getting slapd up and running on a Ubuntu machine so you too can have LDAP running.


Of course there is a bit of installation to take care of before you do anything. But the installation isn’t challenging and there isn’t too much to install. Here are the steps you need to follow:

  1. Open up a terminal window.
  2. Issue the command sudo apt-get install slapd ldap-utils php5-ldap.
  3. Type your sudo password and hit Enter.
  4. Accept any dependencies necessary.

And that’s it. You are now ready for the configuration of slapd. But what to do? This article isn’t about a fancy GUI tool. Instead I have found a script floating around the web (who’s author I can not name because I have seen this script on a number of sites) which actually makes this process amazingly easy. I have posted the script here on pastebin for you to either download or copy and paste.

No matter if you download or copy and paste the script, name it something like and save it in your home directory. Once you have it saved give it executable permissions with the command:

chmod u+x ldap_script

Now the script is almost ready. You do have to make a few simple changes. Near the top of the script you will see:


Obviously you need to change each pleaseeditme entry to suit your needs. For my LDAP server that section lookes like:


You will also notice, near the end of the script, it adds a user. The section #Adding user can be edited to suit your needs, or it can be left alone so that at least one correct user is added at first.

When you have the script ready, it’s time to execute. Issue the command sudo ./ldap_script and watch the magic fly by. When all is said and done you should then be able to check out your LDAP server with one of the means mentioned in previous articles, or you can issue the command:

?ldapsearch -x -h localhost -b "dc=EXAMPLE,dc=COM" "(objectClass=*)"

Where EXAMPLE and COM match your dc entires.

Final thoughts

You should now have your LDAP server up and running. You can start adding entries and managing it with whatever tool (or command line) you want. NOTE: We’ll take a look at the management of LDAP via the command line in later articles. Enjoy your LDAP server!

© Jack Wallen for gHacks Technology News, 2010. | Permalink | Add to, digg, facebook, reddit, twitter
Post tags: , , , , ,

Link to Original Content

For over 30 years, Western Telematic, Inc. (WTI) has been an innovator in the field of remote management for IT facilities. Our comprehensive product line includes a wide range of Serial Console Server products, Switched PDU products and Remote Reboot Switch products to provide secure, remote management of servers, routers and other devices.

Tags: , , , , ,

Comments are closed.