Starting OpenLDAP on Mac OS X Client

Share on Facebook
Post to Google Buzz
Bookmark this on Yahoo Bookmark
Bookmark this on Livedoor Clip
Share on FriendFeed
Starting OpenLDAP on Mac OS X ClientKrypted.com

LDAP is included, by default, installed on every copy of Mac OS X. For Mac OS X Servers its easiest to get LDAP up and running, given that you have a nice handy graphical means of manipulating LDAP in the Open Directory features of Server Admin and Workgroup Manager. But what about Mac OS X Client. It may be easier than you think…

To setup OpenLDAP in Mac OS X, we’ll do three quick tasks. The first is to set a password and the second is to put the password into the configuration file and the third is to start the daemon. To create that password, we’re going to use the slappasswd. Simply use the command and then enter the password twice in order to get a hash that will be representative of your password:

Krypted:~ cedge$ slappasswd
New password:
Re-enter new password:
{SSHA}GxYuEziafPAUJNwP17BRTAlubfPKDRUG

Copy that output into your clipboard. Now cd into the /etc/openldap directory. From there, cp the slapd.conf.default file to the slapd.conf file:

cp slapd.conf.default slapd.conf

Then edit the file. To do so, scroll down to the bottom. Here, you’ll see three things we’re going to change (you can change more if you want and you really only HAVE to change the first). The first is the password. This is the line that begins with rootpw. Delete secret from there and paste in that SHA1 password you created with slappasswd previously. The second and third are the suffix and rootdn information. Here, change company to whatever domain you would like to use and change cn=Manager in the rootdn line where Manager becomes, well, something else (or leave that part). Save your changes to the file.

Now you’re ready to start up the daemon:

slapd -d 255

slapd -d 255

Port scan yourself. If port 389 is running then you are now an OpenLDAP server! Happy LDAPing (with or without slapconfig).

Similar Articles:

Posted on November 29, 2009 at 9:00 am by Charles · Permalink
In: Mac OS X, Mac OS X Server, Mac Security · Tagged with: , , ,

3 Responses

Subscribe to comments via RSS

  1. Written by Arjen
    on December 16, 2009 at 1:00 pm
    Permalink

    Maybe good to notice is that slapd is residing in /usr/libexec, which is not in everyone’s path. Using

    /usr/libexec/slapd -d 255

    should work for everyone.

  2. Written by Matt Connolly
    on April 19, 2011 at 2:06 pm
    Permalink

    On my mac, slapd.conf.default is an empty file. And when I run slapd it exits straight away. Any idea where I can get that file?

  3. Written by Charles
    on April 19, 2011 at 2:28 pm
    Permalink

    Matt, I’m not sure why yours is empty, but if you email me at krypted@me.com I’ll email you a good one.

Subscribe to comments via RSS

Leave a Reply