LDAP Server Howto: Install The Packages
LDAP Server Howto: Install The Packages
PLATFORM:
* Ubuntu Server 10.04 LTS (Lucid)
PREREQUISITES:
* A standard vanilla Ubuntu 10.04 server install.
* An NFS server exporting the users home directorys
Network overview;
* domain name: example.com
* ldap-server 10.1.1.5
We want to install the OpenLDAP server daemon slapd and ldap-utils, a package containing LDAP
management utilities:
Notes:
By default slapd is configured with minimal options needed to run the slapd daemon.
The configuration example in the following sections will match the domain name of the
server. For example, if the machine's Fully Qualified Domain Name (FQDN) is
ldap.example.com, the default suffix will be dc=example,dc=com.
The backend cn=config directory has only a minimal configuration and will need
additional configuration options in order to populate the frontend directory. The
frontend will be populated with a "classical" scheme that will be compatible with
address book applications and with Unix Posix accounts. Posix accounts will allow
authentication to various applications, such as web applications, email Mail Transfer
Agent (MTA) applications, etc.
* For external applications to authenticate using LDAP they will each need to be
specifically configured to do so. Refer to the individual application documentation for
details.
vi ~/backend.ldif
# Database settings
dn: olcDatabase=hdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: {1}hdb
olcSuffix: dc=tuxnetworks,dc=com
olcDbDirectory: /var/lib/ldap
olcRootDN: cn=admin,dc=tuxnetworks,dc=com
olcRootPW: mypassword
olcDbConfig: set_cachesize 0 2097152 0
olcDbConfig: set_lk_max_objects 1500
olcDbConfig: set_lk_max_locks 1500
olcDbConfig: set_lk_max_lockers 1500
olcDbIndex: objectClass eq
olcLastMod: TRUE
olcDbCheckpoint: 512 30
olcAccess: to attrs=userPassword by
dn="cn=admin,dc=tuxnetworks,dc=com" write by anonymous auth by
self write by * none
olcAccess: to attrs=shadowLastChange by self write by * read
olcAccess: to dn.base="" by * read
olcAccess: to * by dn="cn=admin,dc=tuxnetworks,dc=com" write by *
read
* Change olcRootPW: mypassword to a password of your choosing.
vi ~/frontend.ldif
Enter the following contents, once again making the necessary changes to suit your own network:
# Admin user.
dn: cn=admin,dc=tuxnetworks,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword: mypassword
dn: ou=people,dc=tuxnetworks,dc=com
objectClass: organizationalUnit
ou: people
dn: ou=groups,dc=tuxnetworks,dc=com
objectClass: organizationalUnit
ou: groups
dn: uid=brettg,ou=people,dc=tuxnetworks,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: brettg
sn: Glasson
givenName: Brett
cn: Brett Glasson
displayName: Brett Glasson
uidNumber: 1000
gidNumber: 10000
userPassword: mypassword
gecos: Brett Glasson
loginShell: /bin/bash
homeDirectory: /home/brettg
shadowExpire: -1
shadowFlag: 0
shadowWarning: 7
shadowMin: 8
shadowMax: 999999
shadowLastChange: 10877
mail: [email protected]
postalCode: 31000
l: Melbourne
o: tuxnetworks
mobile: +33 (0)6 xx xx xx xx
homePhone: +33 (0)5 xx xx xx xx
title: System Administrator
postalAddress:
initials: BG
dn: cn=users,ou=groups,dc=tuxnetworks,dc=com
objectClass: posixGroup
cn: users
gidNumber: 10000
Notes:
In this example the directory structure, a user, and a group have been setup. In other
examples you might see the objectClass: top added in every entry, but that is the default
behaviour so you do not have to add it explicitly.
We can check that the content has been correctly added with the ldapsearch utility. Execute a search
of the LDAP directory:
dn: uid=brettg,ou=people,dc=,dc=com
cn: Brett Glasson
sn: Glasson
givenName: Brett
Next, you should go ahead and install phpLDAPadmin, add Samba support or configure a client
References:
Ubuntu Docs