Site Navigation
What's This All About?
Linux Server Setup
   Initial LDAP Setup
   NFS Setup
   SAMBA Setup
   Additional LDAP Setup
Linux Client Setup
   LDAP Setup
   NFS Setup
Mac OS X Client Setup
   LDAP Setup
   NFS Setup
Windows 2000 Client/Domain Setup
Adding Users and Final Use


LDAP Setup Instructions:

The first step will be to setup the inital LDAP server, and test it with a standard Linux client to make sure that it is working.

  • Server Configuration
    • Install the Debian slapd package.
    • Choose these settings in the Debian initialization script:
      • directory initialization = auto
      • style = host or domain
      • domain name = host.domain.com (use your server domain)
      • admin password = secret
      • replicate = no
    • /etc/ldap/slapd.conf configuration file.
      • Examine suffix, make sure it fits for your server/domain
      • access control. This is who is allowed to see/edit entries (admin)
      • sample slapd.conf
    • LDAP Tools Configuration:
      • Intall the Debian ldap-util package.
      • To test server installation:

        Code:

        ldapsearch -x -h host.domain.com -b 'dc=host,dc=domain,dc=com'

        Use the code above to test the LDAP database, but substitute your LDAP server information. So, for our test ldap server at muppet.cs.dixie.edu, our entry would be " 'ldapsearch -x -h muppet.cs.dixie.edu -b 'dc=muppet,dc=cs,dc=dixie,dc=edu' "

        This should return a number of records, looking roughly like this:

        Code:

        version: 2

        #
        # filter: (objectclass=*)
        # requesting: ALL
        #

        # muppet, cs, dixie, edu
        dn: dc=muppet,dc=cs,dc=dixie,dc=edu
        objectClass: dcObject
        dc: muppet

        # admin, muppet, cs, dixie, edu
        dn: cn=admin,dc=muppet,dc=cs,dc=dixie,dc=edu
        objectClass: organizationalRole
        objectClass: simpleSecurityObject
        cn: admin
        description: LDAP administrator

        # People, muppet, cs, dixie, edu
        dn: ou=People,dc=muppet,dc=cs,dc=dixie,dc=edu
        objectClass: organizationalUnit
        ou: People

        # Roaming, muppet, cs, dixie, edu
        dn: ou=Roaming,dc=muppet,dc=cs,dc=dixie,dc=edu
        objectClass: organizationalUnit
        ou: Roaming

        # search result
        search: 2
        result: 0 Success

        # numResponses: 5
        # numEntries: 4

    • We now need to add a type into the LDAP directory for a group organizational unit

      • download this file for the GroupOU.ldif and rename it to GroupOU.ldif (it is a .txt file now). Also, you will need to edit the file and change the dn= entry to match your server domain.

      • run this command to add the Group info into ldap, substituting for YOUR server information:

        Code:

        ldapadd -x -D 'cn=admin,dc=muppet,dc=cs,dc=dixie,dc=edu' -W -f GroupOU.ldif

      • Now, run this command (substituting for YOUR server information) to test that the Group data was added into LDAP:

        Code:

        ldapsearch -x -D 'cn=admin,dc=muppet,dc=cs,dc=dixie,dc=edu' -W -b 'dc=muppet,dc=cs,dc=dixie,dc=edu' '(ou=Group)'

        Which should return results similar to this:

        Code:

        version: 2

        #
        # filter: (ou=Group)
        # requesting: ALL
        #

        # Group, muppet, cs, dixie, edu
        dn: ou=Group,dc=muppet,dc=cs,dc=dixie,dc=edu
        ou: Group
        objectClass: top
        objectClass: organizationalUnit

        # search result
        search: 2
        result: 0 Success

        # numResponses: 2
        # numEntries: 1

    • Now our LDAP database should be setup and ready to add a test user. This is NOT the final setup, as we will have to change LDAP to work with samba later on, and that will change our LDAP entries for our users. So, do NOT enter any real accounts, just a test account, to make sure it is all working.

      • Downlaod this ldif (ldap information file) file: posix.ldif, and rename it to posix.ldif (instead of posix.txt) and edit the file to have your server's domain information.

      • This file is the information for ONE user account. This is a test user, named Buckaroo Bonzai. You would have to make a separate file for EVERY user you want to add into the database.

      • Add the file into the database:

        Code:

        ldapadd -x -D 'cn=admin,dc=muppet,dc=cs,dc=dixie,dc=edu' -W -f posix.ldif

        Remember to use your domain information for your ldap server.

      • Now, search for that user to test that he was added (using your domain info):

        Code:

        ldapsearch -x -h piggy.muppet.cs.dixie.edu -b 'dc=muppet,dc=cs,dc=dixie,dc=edu' '(objectClass=posixAccount)'

        Which should return results similar to this:

        Code:

        version: 2

        #
        # filter: (objectClass=posixAccount)
        # requesting: ALL
        #

        # bbonzai, People, muppet, cs, dixie, edu
        dn: uid=bbonzai,ou=People,dc=muppet,dc=cs,dc=dixie,dc=edu
        objectClass: top
        objectClass: account
        objectClass: posixAccount
        objectClass: shadowAccount
        cn: Buckaroo Bonzai
        uid: bbonzai
        uidNumber: 11000
        gidNumber: 11000
        homeDirectory: /home/bbonzai
        loginShell: /bin/bash
        gecos: Buckaroo Bonzai,Bonzai Labs 101,888-555-1234,555-4321
        shadowLastChange: 0
        shadowMax: 0
        shadowWarning: 0

        # search result
        search: 2
        result: 0 Success

        # numResponses: 2
        # numEntries: 1

      • Now that we have added a user account, we also need to add a group account for that same user (all *nix users also have a group of their own)

      • Downlaod this ldif (ldap information file) file: group.ldif, and rename it to group.ldif (instead of group.txt) and edit the file to have your server's domain info.

      • This file is the information for ONE group account, for our test user, Buckaroo Bonzai. You would have to make a separate group file for EVERY user you want to add into the database, so that they also have a group.

      • Add the file into the database (using your domain):

        Code:

        ldapadd -x -D 'cn=admin,dc=muppet,dc=cs,dc=dixie,dc=edu' -W -f group.ldif

      • Now, search for that group to test that it was added (using your domain info):

        Code:

        ldapsearch -x -h piggy.muppet.cs.dixie.edu -b 'dc=muppet,dc=cs,dc=dixie,dc=edu' '(objectClass=posixGroup)'


        Which should return results similar to this:

        Code:


        version: 2

        #
        # filter: (objectClass=posixGroup)
        # requesting: ALL
        #

        # bbonzai, Group, muppet, cs, dixie, edu
        dn: cn=bbonzai,ou=Group,dc=muppet,dc=cs,dc=dixie,dc=edu
        objectClass: top
        objectClass: posixGroup
        cn: bbonzai
        gidNumber: 11000

        # search result
        search: 2
        result: 0 Success

        # numResponses: 2
        # numEntries: 1

      • If all of these steps seem to be working correctly, then you should have your ldap server up and running correctly. Now, the best way to test it is to set up another linux machine as a client for this ldap server. Go to the Linux: Client: LDAP Setup section for instructions to see how to do this.

      • Remember, we are NOT done with the LDAP setup. Do NOT add real users to the system yet. We will make changes to LDAP after we setup samba, and that will change the information for the LDAP accounts. Also, keep in mind that when you test this out on a normal Linux client, the user (bbonzai) does NOT have a home directory yet, so that part will not work. But you should be able to login as that user, or at the very least finger bbonzai to get his info


      The next step is to set up the NFS server for the home directories. Proceed to the Linux Server: NFS section to continue.