This document assumes you are using Ubuntu Server 6.06 (dapper) for both the server and client. It also assumes using Kerberos (Active Directory) for all authentication. If you want to use OpenLDAP for authentication, use the pam_ldap module.
We want to set-up a host named accounts.student.cs.uwaterloo.ca
with the OpenLDAP server to house account information (home directory, login shell, etc...) for Unix computers in the undergraduate teaching environment run by CSCF. Since the students have Active Directory accounts already for the Mac Labs and Terminal server, we'll use the Active Directory for authentication.
ldap
service principal and generate a keytab file.
/etc/krb5.keytab
and run chmod 600 /etc/krb5.keytab
apt-get install slapd
. It doesn't matter what answers you give to the Debian configuration program, since you are just going to blow away the database anyway. We'll assume you have OpenLDAP 2.2.x.
/etc/init.d/slapd stop
.
/var/lib/ldap
.
/etc/ldap/slapd.conf
. Here is a sample.
slapadd
, initialize the database with some entries.
slapindex
to generate search indices.
/etc/init.d/slapd start
.
ldapadd
, add some users and groups.
There are three noticeable changes:
slapd
daemon runs as user openldap
rather than root
.
sasl2
and slapd
working.
/etc/ldap/slapd.conf
.
The changes above imply the following:
slapindex
, make sure the contents of /var/lib/ldap
have ownership openldap:openldap
.
openldap
user needs to be able to read the keytab file that contains the ldap
service principal.
/etc/ldap/sasl2/slapd.conf
(not to be confused with /etc/ldap/slapd.conf
) containing some sasl
directives: mech_list: GSSAPI
keytab: /path/to/keytab
slapd.conf(5)
before editing /etc/ldap/slapd.conf
.
We want to configure the host krbtux.student.cs.uwaterloo.ca
to make use of accounts that exist in the directory on the OpenLDAP server accounts.student.cs.uwaterloo.ca
. We'll use the STUDENT.CS.UWATERLOO.CA
realm for authentication.
apt-get install libnss-ldap
.
krbtux
in the OpenLDAP directory.
/etc/nsswitch.conf
:
passwd: compat ldap group: compat ldap shadow: compat ldap
/etc/libnss-ldap.conf
only needs to contain the following lines:
host accounts.student.cs.uwaterloo.ca base dc=ldap,dc=student,dc=cs,dc=uwaterloo,dc=ca ldap_version 3 nss_base_passwd ou=People,dc=ldap,dc=student,dc=cs,dc=uwaterloo,dc=ca?one nss_base_shadow ou=People,dc=ldap,dc=student,dc=cs,dc=uwaterloo,dc=ca?one nss_base_group ou=Groups,dc=ldap,dc=student,dc=cs,dc=uwaterloo,dc=ca?one use_sasl on rootuse_sasl on SASL_MECH GSSAPI
The root
account will need to run kinit -k host/krbtux.student.cs.uwaterloo.ca
so that the host can get credentials to read the data in the directory.
root
to keep a valid credential cache for the host
service principal all the time. For example, run /usr/bin/kdestroy;/usr/bin/kinit -k host/krbtux.student.cs.uwaterloo.ca
via cron
.
-- JasonTestart - 24 Apr 2007
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
![]() |
group.ldif | r1 | manage | 0.1 K | 2007-03-23 - 11:06 | JasonTestart | |
![]() |
init.ldif | r1 | manage | 0.4 K | 2007-03-23 - 10:45 | JasonTestart | |
![]() |
krbtux.ldif | r1 | manage | 0.2 K | 2007-03-23 - 10:54 | JasonTestart | |
![]() |
slapd.conf | r1 | manage | 1.6 K | 2007-03-23 - 10:53 | JasonTestart | |
![]() |
user.ldif | r1 | manage | 0.3 K | 2007-03-23 - 11:06 | JasonTestart |