Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Setting up an LDAP server

Setting up an LDAP server
Thread Tools
Patton76
Junior Member
Join Date: Sep 2001
Location: Belgium
Status: Offline
Reply With Quote
Sep 14, 2002, 01:01 PM
 
Is it possible to sep up an ldap server in 10.2?

And if yes, how do I do it?
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Sep 14, 2002, 01:04 PM
 
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
Patton76  (op)
Junior Member
Join Date: Sep 2001
Location: Belgium
Status: Offline
Reply With Quote
Sep 14, 2002, 03:29 PM
 
Originally posted by Kristoff:
http://www.openldap.org/
Tried it, but it didn't work.

I couldn't get it to compile.
     
Mithras
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Sep 14, 2002, 09:51 PM
 
Actually, OpenLDAP already is included in Jaguar.

/usr/libexec/slapd is the LDAP server.
man slapd will tell you some of the basics of how to start it up.

There's also a StartupItem in /System/Library/StartupItems/LDAP

If you add a line that reads
LDAPSERVER=-YES- to /etc/hostconfig, then the ldap server will start automatically at boot. You'll need to first do some configuration, though.

Apple includes configuration files to operate it as an authentication server, delivering your local users, passwords, and home folders.

I'd like to set it up with Addressbook info, though. I don't know much about LDAP schema and the like; if anyone has insight to offer, I'd love to hear it.

mithras
     
Patton76  (op)
Junior Member
Join Date: Sep 2001
Location: Belgium
Status: Offline
Reply With Quote
Sep 15, 2002, 01:14 PM
 
I managed to compile and install the ldap server at openldap.org.

Now I need to configure it.

Is there someone here who can help out?

Any help would be appreciated.
     
akebono
Dedicated MacNNer
Join Date: Oct 1999
Status: Offline
Reply With Quote
Sep 15, 2002, 07:43 PM
 
LDAP is one of the most poorly documented projects on the internet. Good luck, and please write a howto after you learn it.
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Sep 16, 2002, 10:58 AM
 
Actually, the more I look into this, the more I want to set this up on my Jag system. We really need someone to explain how to configure LDAP!!!

I opened my big mouth at a staff meeting about a possible implementation of an LDAP server for the building (around 200+ people) and now they would like to see a test bed. That's when I said that I need an OS X server bos... they in turn said "what, you CAN'T do it with what you have"

I hate the word "can't" when they are talking about my computer!

So here I am... feverishly looking for a site to guide me through it, but it doesn't look good.

If anyone could help...
     
Patton76  (op)
Junior Member
Join Date: Sep 2001
Location: Belgium
Status: Offline
Reply With Quote
Sep 16, 2002, 02:01 PM
 
Well I have ldp running, but that's about it. I have absolutely no clue how to configure, or how to link address book to it.

I've looked into a lot of info, but most of it is Chinese to me

I guess someone on this planet should know how to do it. So share it with us!
     
davidfindley
Fresh-Faced Recruit
Join Date: Sep 2002
Status: Offline
Reply With Quote
Sep 17, 2002, 02:00 AM
 
LDAP In 10.2 HOWTO, or "Hold on, this may get a bit bumpy..."

Disclaimer: this will work using the built-in LDAP and integrate with Address Book. I do not claim that its the best or most complete or most optimal setup. I will certainly try to answer any questions, though I am by no means an LDAP expert. I also make no claim that this won't wipe out your hard drive, though it hasn't happened to me yet.

Do you feel lucky? Let's go!

Major steps you need to do:

1) Create a usable "slapd.conf" file.
---a) We'll create this on your desktop first.
---b) Then copy it via the command shell to where it needs to go.
2) Create folder where LDAP database files will reside.
3) Start up slapd by hand.
4) Add "parent entry" that users will belong to.
---a) We'll create an "ldif" file on your desktop that contains the entry.
---b) We'll run a command line program to load the entry into the LDAP database.
5) Add a sample user or two.
---a) We'll create another "ldif" file on your deskto that contains the entries.
---b) We'll run a command line program to load the users into the LDAP database.
6) Configure Address Book.
7) Test Address Book.

Ok, here are the instructions for each step:

1a) Create a new file "slapd.conf" on your desktop. I use BBEdit, as this file MUST BE a UNIX style file (with LineFeed endings ONLY). You can use vi or emacs if you like. Word or TextEdit WILL NOT WORK!!! The file is below:

====== START OF slapd.conf. DO NOT INCLUDE THIS LINE =====
# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.8.8.7 2001/09/27 20:00:31 kurt Exp $
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#

include /private/etc/openldap/schema/core.schema
include /private/etc/openldap/schema/cosine.schema
include /private/etc/openldap/schema/inetorgperson.schema

# Define global ACLs to disable default read access.

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org

pidfile /var/run/slapd.pid
argsfile /var/run/slapd.args

# Load dynamic backend modules:
# modulepath %MODULEDIR%
# moduleload back_ldap.la
# moduleload back_ldbm.la
# moduleload back_passwd.la
# moduleload back_shell.la

#
# Sample Access Control
# Allow read access of root DSE
# Allow self write access
# Allow authenticated users read access
# Allow anonymous users to authenticate
#
#access to dn="" by * read
#access to *
# by self write
# by users read
# by anonymous auth
#
# if no access controls are present, the default is:
# Allow read by all
#
# rootdn can always write!

################################################## #####################
# ldbm database definitions
################################################## #####################

database ldbm
suffix "dc=example,dc=com"
#suffix "o=My Organization Name,c=US"
rootdn "cn=Manager,dc=example,dc=com"
#rootdn "cn=Manager,o=My Organization Name,c=US"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd/tools. Mode 700 recommended.
directory /usr/local/openldap-ldbm
# Indices to maintain
index objectClass eq
index cn,sn eq,sub,approx


====== END OF slapd.conf. DO NOT INCLUDE THIS LINE =====

1b) Open a terminal window. Assuming that slapd.conf (file name must be all lowercase) is on your desktop:

cd Desktop
sudo -s
(type your user password... if you have never done this before, also answer the question that comes up in the affirmative)
cp slapd.conf /etc/openldap/slapd.conf

2) Still in terminal? If not, open it back up and "sudo -s" to become root again, then:

cd /usr/local
mkdir openldap-ldbm
chmod 600 openldap-ldbm

3) You didn't close the terminal again, did you? If so, open it back up and "sudo -s" to become root again, then:

/usr/libexec/slapd
exit

4) Keep that terminal open! But you don't need to be root anymore, that's what the "exit" was for in step 3. It's always best to not be root if you can help it, though.

4a) Create a new file "first_time.ldif" on your desktop. Again, I use BBEdit, as this file MUST BE a UNIX style file (with LineFeed endings ONLY). Again, you can use vi or emacs if you like. Again, Word or TextEdit WILL NOT WORK!!! The file is below:

====== START OF first_time.ldif. DO NOT INCLUDE THIS LINE =====
dn: dc=example,dc=com
objectclass: dcObject
objectclass: organization
o: My Company Name
dc: example

====== END OF first_time.ldif. DO NOT INCLUDE THIS LINE =====

4b) In the terminal, run the following command (from anywhere, since the ldapadd program is in your path by default):

ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f first_time.ldif

5a) Create a new file "users.ldif" on your desktop. Again, I use BBEdit, as this file MUST BE a UNIX style file (with LineFeed endings ONLY). Again, you can use vi or emacs if you like. Again, Word or TextEdit WILL NOT WORK!!! The file is below: (feel free to add more entries, of course, and chose whatever actual data you like...) And that's a lowercase L in front of the city, not a "numeral one."

====== START OF users.ldif. DO NOT INCLUDE THIS LINE =====
dn: cn=Steve Jobs,dc=example,dc=com
objectclass: inetorgperson
cn: Steve Jobs
givenName: Steve
sn: Jobs
mail: [email protected]
street: 123 Main Street
l: Beverly Hills
st: CA
postalCode: 90210
telephoneNumber: 123-456-7890

dn: cn=David Findley,dc=example,dc=com
objectclass: inetorgperson
cn: David Findley
givenName: David
sn: Findley
mail: [email protected]
street: 123 Oak Street
l: Beverly Hills
st: CA
postalCode: 90210
telephoneNumber: 123-789-4560

====== END OF users.ldif. DO NOT INCLUDE THIS LINE =====

5b) In the terminal, run the following command (from anywhere, since the ldapadd program is in your path by default):

ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f users.ldif

6) Go to Address Book, Preferences, click on the LDAP tab, click the Add button, then fill in the top 3 fields as below:

Name: My LDAP Server (or whatever you want, really, this is just "cosmetic")
Server: 127.0.0.1
Search Base: dc=example,dc=com

Leave the rest of the fields alone, and click Save. Close the Preferences window.

7) In the Group column, click Directories. Click on "My LDAP Server" (or whatever you called it) in the Directories column. In the search field, type the first letter of either a first or last name of a user you loaded. If you didn't fiddle with the entries I made, D or F or S or J will work. If you have multiple users, more letters should narrow entries down.

Notice it'll spin and bring up an entry. Drag it to the All group in the Group column. Click on the All group in the Group column. Click on the name that you just dragged over there. You should see the populated info.

Ok, that's all for now. Have fun! And please visit http://www.openldap.org/ and click on either the Documentation or the Quick Start Guide. (I read the Quick Start Guide first.)

David Findley
     
Mithras
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Sep 17, 2002, 07:36 AM
 
Lovely, thank you, thank you, thank you.

As for using your own Addressbook information, any bites?

I found one vCard to LDIF translator, mentioned in this message and available for download here.

However it is pretty crufty and I'm not up to porting it all -- funny yacc stuff I don't know anything about.

The next option is probably the better: convert directly, using the Addressbook API. It looks pretty straightforward.
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Sep 17, 2002, 08:19 AM
 
If you would like to edit or create these files, I would use pico in the command line. It's foolproof...
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Sep 17, 2002, 08:30 AM
 
1) So basically we have to hand code the users.ldif file every time we would like to add or subtract a person? (I know I could make a perl module or something, I'm just asking)

2) Is there any security with this system? (Just wondering) It looks rather wide open if you ask me...
     
davidfindley
Fresh-Faced Recruit
Join Date: Sep 2002
Status: Offline
Reply With Quote
Sep 17, 2002, 09:14 AM
 
Originally posted by Mithras:

The next option is probably the better: convert directly, using the Addressbook API. It looks pretty straightforward.
This sounds like the best idea, but I haven't tried it yet. Should be the easiest solution, though. You could even use the Novell Java classes and skip the LDIF step altogether: out one API and into another! LDIF is just a convenient human-readable text-based representation. Really good for making backups of your LDAP database. Just dump the whole thing to LDIF from time to time and back up the file.

Originally posted by mitchell_pgh:
1) So basically we have to hand code the users.ldif file every time we would like to add or subtract a person? (I know I could make a perl module or something, I'm just asking)

2) Is there any security with this system? (Just wondering) It looks rather wide open if you ask me...
Pico is also a good idea for editing, I forgot to mention that one, thanks!

1) Only if you want to use the supplied command line tools, yes. I am actually in the middle of writing some JSP pages (Novell has a pretty good set of Java classes that work well with OpenLDAP) that allows easier editing. I haven't found any general purpose GUI editing tools, though I haven't honestly looked very much yet. If you are proficient with Perl, that would also be a good solution.

2) Security is controlled by settings in the slapd.conf file. In my example, I have added no settings, so the default is:

# if no access controls are present, the default is:
# Allow read by all
#
# rootdn can always write!

So, yes, it's wide open for reading, but only the person who sets up the slapd.conf file (and therefore knows the rootdn password) can modify the database. Note I also used only "basic" security, which works fine as long as you don't try to manage this database remotely, as you'll be sending the password in cleartext. If you are looking to do "true" remote management, there are additional security controls you can/should implement.

David Findley
     
Patton76  (op)
Junior Member
Join Date: Sep 2001
Location: Belgium
Status: Offline
Reply With Quote
Sep 17, 2002, 03:53 PM
 
Thanks alot, it works great!!!!

Now the only thing we should know, if it's possible to link addressbook to the ldap server, or else a nice way to make the LDIF files.

I do have some questions, but I'll study it all a bit first, so I know what I ask
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Sep 17, 2002, 05:53 PM
 
There is an ldap browser/editor by Jarek Gawor found here

I have used it for quite some time and it works very well.

You can make custom templates and such.

It is 100% java and works fine on OS X.
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
soellman
Fresh-Faced Recruit
Join Date: Sep 2001
Location: san francisco
Status: Offline
Reply With Quote
Sep 17, 2002, 08:40 PM
 
Originally posted by Kristoff:
There is an ldap browser/editor by Jarek Gawor found here

I have used it for quite some time and it works very well.

You can make custom templates and such.

It is 100% java and works fine on OS X.
yea that's the one I've used for ages, works like a champ on 10.0-2. If you want to get crazy, you can even have osx workstations authenticate from the ldap server, you just have to extend each of your address book entries in ldap to include support for rfc2307, I think. I got this to work with 10.1, but had some cross-platform issues authenticating linux users as well, having to do with the proper encryption hash in the password field.

If you are doing this, then you will want to modify your access control to disallow read access for everyone to the password field, but allow anonymous users to authenticate, and authenticated users to read all of their own entry. There are tutorials out there somewhere..

and of course, I've heard that 10.2 server uses ldap for its netinfo store, so there might be a nice little gui for it all. I dunno.
-o
     
Patton76  (op)
Junior Member
Join Date: Sep 2001
Location: Belgium
Status: Offline
Reply With Quote
Sep 18, 2002, 02:11 PM
 
Thanks for the link to LDAP browser. I can connect to the server I set up, but can't add entries.

I guess I have to fill in the fields UserDn and password.

The problem is that I don't know what to fill in there.

What's my userdn if I had followed the instructions above? I guess pasword is my user password, right?
     
davidfindley
Fresh-Faced Recruit
Join Date: Sep 2002
Status: Offline
Reply With Quote
Sep 18, 2002, 07:33 PM
 
Originally posted by Patton76:
Thanks for the link to LDAP browser. I can connect to the server I set up, but can't add entries.

I guess I have to fill in the fields UserDn and password.

The problem is that I don't know what to fill in there.

What's my userdn if I had followed the instructions above? I guess pasword is my user password, right?
I couldn't get version 2.7 to add an entry. I kept getting a Java exception. And it looks like version 2.8 doesn't have immediate support for "inetorgperson," though I'm going to investigate the config files... perhaps I can add the ability.

In the meantime, you can "add" people by duplicating an entry (select a person and choose: "Edit"->"Copy Entry...") and then change the attributes.

To do that, make sure "Anonymous bind" is unchecked, and User DN: should be "cn=Manager,dc=example,dc=com" (no quotes) with "append base DN" unchecked. (Or, "cn=Manager" [no quotes] with "append base DN" checked. Your choice. )

The password is "secret" (no quotes). Of course, if you've changed the password (near the bottom of slapd.conf on the line that starts with "rootpw"), you'll have to use that instead.

This looks like quite a nice program (excepting the Java Look and Feel instead of Aqua), so I'm going to investigate how to make is support "inetorgperson" and will post directions here if I am successful.

David Findley

Update: I leapt before I looked. It's VERY easy to add support for inetorgperson. Simply select an existing user and choose "Edit"->"Create Template..." and accept the "inetorgperson" name, and press Create.

Then, to add a new user, MAKE SURE you've chosen the parent at the very top (not a user), and choose "Edit"->"Add Entry"->"inetorgperson". Fill in the blanks and hit Apply. This is turning out to be quite an impressive application. Now if I can just turn the look and feel back to Aqua like in 2.7, and put the Menu bar at the top of the screen, I'll be really happy!
( Last edited by davidfindley; Sep 18, 2002 at 07:48 PM. )
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Sep 18, 2002, 09:56 PM
 
this is turning out to be very cool... I guess I will get to look like the champ after all...

Thanks all...
     
davidfindley
Fresh-Faced Recruit
Join Date: Sep 2002
Status: Offline
Reply With Quote
Sep 19, 2002, 11:08 AM
 
Originally posted by mitchell_pgh:
this is turning out to be very cool... I guess I will get to look like the champ after all...

Thanks all...
Let us know how it turns out. I too really hate when people tell me "You can't do that on a Mac."

     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:52 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,