<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=LDAP_UCL_IIHE</id>
	<title>LDAP UCL IIHE - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=LDAP_UCL_IIHE"/>
	<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=LDAP_UCL_IIHE&amp;action=history"/>
	<updated>2026-06-06T07:55:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://t2bwiki.iihe.ac.be/index.php?title=LDAP_UCL_IIHE&amp;diff=162&amp;oldid=prev</id>
		<title>Maintenance script: Created page with &quot; === Procedure for the installation of the LDAP master server at IIHE === This procedure describes the installation on a Fedora Core 10 machine.  ==== RPM installation ====...&quot;</title>
		<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=LDAP_UCL_IIHE&amp;diff=162&amp;oldid=prev"/>
		<updated>2015-08-26T12:28:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; === Procedure for the installation of the LDAP master server at IIHE === This procedure describes the installation on a Fedora Core 10 machine.  ==== RPM installation ====...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
=== Procedure for the installation of the LDAP master server at IIHE ===&lt;br /&gt;
This procedure describes the installation on a Fedora Core 10 machine.&lt;br /&gt;
&lt;br /&gt;
==== RPM installation ====&lt;br /&gt;
To install the needed RPM, just type :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
yum install openldap-servers&lt;br /&gt;
yum install openldap-clients&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== LDAP service configuration ====&lt;br /&gt;
The service must be start automatically :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chkconfig --level 345 ldap on&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameters to be passed at the starting of the LDAP service can be added or changed in the /etc/sysconfig/ldap file. Modifying this file, we can, for example, define the URLs that must be used to access the LDAP service.&lt;br /&gt;
&lt;br /&gt;
Now, adpapt the LDAP service configuration file /etc/openldap/slapd.conf :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include		/etc/openldap/schema/core.schema&lt;br /&gt;
include		/etc/openldap/schema/cosine.schema&lt;br /&gt;
include		/etc/openldap/schema/inetorgperson.schema&lt;br /&gt;
include		/etc/openldap/schema/nis.schema&lt;br /&gt;
&lt;br /&gt;
# Allow LDAPv2 client connections.  This is NOT the default.&lt;br /&gt;
allow bind_v2&lt;br /&gt;
&lt;br /&gt;
pidfile		/var/run/openldap/slapd.pid&lt;br /&gt;
argsfile	/var/run/openldap/slapd.args&lt;br /&gt;
loglevel	2047&lt;br /&gt;
&lt;br /&gt;
# Load dynamic backend modules:&lt;br /&gt;
# modulepath	/usr/lib/openldap # or /usr/lib64/openldap&lt;br /&gt;
# The following module is needed for replication with shadow LDAP server&lt;br /&gt;
modulepath	/usr/lib64/openldap&lt;br /&gt;
moduleload syncprov.la&lt;br /&gt;
&lt;br /&gt;
# The next three lines allow use of TLS for encrypting connections&lt;br /&gt;
TLSCACertificateFile /etc/pki/tls/ldap/certs/ldap01_iihe_ac_be-bundle.pem&lt;br /&gt;
TLSCertificateFile /etc/pki/tls/ldap/certs/ldap01_iihe_ac_be.crt&lt;br /&gt;
TLSCertificateKeyFile /etc/pki/tls/ldap/private/ldap01_iihe_ac_be.key&lt;br /&gt;
&lt;br /&gt;
TLSVerifyClient try&lt;br /&gt;
&lt;br /&gt;
# Sample security restrictions&lt;br /&gt;
#	Require integrity protection (prevent hijacking)&lt;br /&gt;
#	Require 112-bit (3DES or better) encryption for updates&lt;br /&gt;
#	Require 63-bit encryption for simple bind&lt;br /&gt;
#security ssf=1 update_ssf=112 simple_bind=64&lt;br /&gt;
&lt;br /&gt;
# disable anonymous bind&lt;br /&gt;
disallow bind_anon&lt;br /&gt;
&lt;br /&gt;
# Access restricted to the password (even if they are hashed !)&lt;br /&gt;
access to attrs=userPassword&lt;br /&gt;
	by dn=&amp;quot;cn=manager,dc=tier2,dc=be&amp;quot; write&lt;br /&gt;
	by dn=&amp;quot;uid=syncrepl,ou=System,dc=tier2,dc=be&amp;quot; write&lt;br /&gt;
	by dn=&amp;quot;uid=proxyuser,ou=System,dc=tier2,dc=be&amp;quot; read&lt;br /&gt;
	by self write&lt;br /&gt;
	by anonymous auth&lt;br /&gt;
	by * none&lt;br /&gt;
&lt;br /&gt;
# Prevent simple users to modify their uid and gid&lt;br /&gt;
access to attrs=uidNumber,gidNumber&lt;br /&gt;
	by dn=&amp;quot;cn=manager,dc=tier2,dc=be&amp;quot; write&lt;br /&gt;
	by dn=&amp;quot;uid=syncrepl,ou=System,dc=tier2,dc=be&amp;quot; write&lt;br /&gt;
	by dn=&amp;quot;uid=proxyuser,ou=System,dc=tier2,dc=be&amp;quot; read&lt;br /&gt;
	by self read&lt;br /&gt;
	by anonymous auth&lt;br /&gt;
	by * none&lt;br /&gt;
&lt;br /&gt;
# Access read-only for everybody to the rest of the directory&lt;br /&gt;
access to *&lt;br /&gt;
	by dn=&amp;quot;cn=manager,dc=tier2,dc=be&amp;quot; write&lt;br /&gt;
	by dn=&amp;quot;uid=syncrepl,ou=System,dc=tier2,dc=be&amp;quot; write&lt;br /&gt;
	by dn=&amp;quot;uid=proxyuser,ou=System,dc=tier2,dc=be&amp;quot; read&lt;br /&gt;
	by self write&lt;br /&gt;
	by anonymous auth&lt;br /&gt;
	by users read&lt;br /&gt;
&lt;br /&gt;
#######################################################################&lt;br /&gt;
# Backend database definition&lt;br /&gt;
#######################################################################&lt;br /&gt;
&lt;br /&gt;
database	bdb&lt;br /&gt;
suffix		&amp;quot;dc=tier2,dc=be&amp;quot;&lt;br /&gt;
#checkpoint	1024 15&lt;br /&gt;
rootdn		&amp;quot;cn=manager,dc=tier2,dc=be&amp;quot;&lt;br /&gt;
rootpw		{MD5}C0v0wBolHmN9pDpfWbdxyz==&lt;br /&gt;
&lt;br /&gt;
# The database directory MUST exist prior to running slapd AND &lt;br /&gt;
# should only be accessible by the slapd and slap tools.&lt;br /&gt;
# Mode 700 recommended and owner must be ldap user&lt;br /&gt;
directory	/var/lib/ldap&lt;br /&gt;
&lt;br /&gt;
# Indices to maintain for this database&lt;br /&gt;
index objectClass                       eq,pres&lt;br /&gt;
index ou,cn,mail,surname,givenname      eq,pres,sub&lt;br /&gt;
index uidNumber,gidNumber,loginShell    eq,pres&lt;br /&gt;
index uid,memberUid                     eq,pres,sub&lt;br /&gt;
index nisMapName,nisMapEntry            eq,pres,sub&lt;br /&gt;
index nisDomain				eq&lt;br /&gt;
# indices added for syncrepl&lt;br /&gt;
index entryCSN,entryUUID		eq&lt;br /&gt;
&lt;br /&gt;
# loads and configures the syncprov overlay&lt;br /&gt;
overlay syncprov&lt;br /&gt;
syncprov-checkpoint 50 10&lt;br /&gt;
syncprov-sessionlog 100&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, as we didn&amp;#039;t want the manager&amp;#039;s account password to appear in clear, we encrypted it with :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slappassword -h &amp;#039;{MD5}&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and we simply copy-past the result in slapd.conf (see the value of rootpw).&lt;br /&gt;
&lt;br /&gt;
This configuration file enables two important features :&lt;br /&gt;
*A security layer with TLS/SSL (authentication of the server by its certificate and encryption)&lt;br /&gt;
*Replication to another shadow server with syncrepl&lt;br /&gt;
&lt;br /&gt;
From the above config file, you also guess that the LDAP directory content will be stored into a BDB database. Before this backend is created, you must be sure that the user ldap exists, and then check that the directory /var/lib/ldap exists with permission 700 and owner ldap. If it is not the case :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
useradd ldap&lt;br /&gt;
mkdir /var/lib/ldap&lt;br /&gt;
chmod 700 /var/lib/ldap&lt;br /&gt;
chown -R ldap:ldap /var/lib/ldap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For tuning the performance of the Berkeley DB backends, a file DB_CONFIG is needed in /var/lib/ldap :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/share/doc/openldap-servers-2.4.12/DB_CONFIG.example /var/lib/ldap/DB_CONFIG&lt;br /&gt;
chown ldap /var/lib/ldap/DB_CONFIG&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we have to configure the local client tool, changing /etc/openldap/ldap.conf, because we need it to make some checks on the server :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BASE		dc=iihe,dc=ac,dc=be&lt;br /&gt;
URI		ldap://ldap.iihe.ac.be/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test server configuration ====&lt;br /&gt;
To simply test the configuration, just type :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service ldap configtest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Populate the LDAP directory ====&lt;br /&gt;
We will populate the directory with the following ldif file :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dn: dc=tier2,dc=be&lt;br /&gt;
dc: tier2&lt;br /&gt;
description: Toplevel domain&lt;br /&gt;
associatedDomain: tier2.be&lt;br /&gt;
nisDomain: tier2.be&lt;br /&gt;
objectClass: top&lt;br /&gt;
objectClass: domain&lt;br /&gt;
objectClass: domainRelatedObject&lt;br /&gt;
&lt;br /&gt;
dn: dc=iihe,dc=tier2,dc=be&lt;br /&gt;
dc: iihe&lt;br /&gt;
objectClass: top&lt;br /&gt;
objectClass: domain&lt;br /&gt;
objectClass: domainRelatedObject&lt;br /&gt;
description: IIHE&amp;#039;s subdomain&lt;br /&gt;
associatedDomain: iihe.tier2.be&lt;br /&gt;
&lt;br /&gt;
dn: dc=fynu,dc=tier2,dc=be&lt;br /&gt;
dc: fynu&lt;br /&gt;
objectClass: top&lt;br /&gt;
objectClass: domain&lt;br /&gt;
objectClass: domainRelatedObject&lt;br /&gt;
description: FYNU&amp;#039;s subdomain&lt;br /&gt;
associatedDomain: fynu.tier2.be&lt;br /&gt;
&lt;br /&gt;
dn: ou=Group,dc=fynu,dc=tier2,dc=be&lt;br /&gt;
objectClass: top&lt;br /&gt;
objectClass: organizationalUnit&lt;br /&gt;
ou: Group&lt;br /&gt;
description: The groups&lt;br /&gt;
&lt;br /&gt;
dn: ou=People,dc=fynu,dc=tier2,dc=be&lt;br /&gt;
objectClass: top&lt;br /&gt;
objectClass: organizationalUnit&lt;br /&gt;
ou: People&lt;br /&gt;
description: The users&lt;br /&gt;
&lt;br /&gt;
dn: ou=Group,dc=iihe,dc=tier2,dc=be&lt;br /&gt;
objectClass: top&lt;br /&gt;
objectClass: organizationalUnit&lt;br /&gt;
ou: Group&lt;br /&gt;
description: The groups&lt;br /&gt;
&lt;br /&gt;
dn: ou=People,dc=iihe,dc=tier2,dc=be&lt;br /&gt;
objectClass: top&lt;br /&gt;
objectClass: organizationalUnit&lt;br /&gt;
ou: People&lt;br /&gt;
description: The users&lt;br /&gt;
&lt;br /&gt;
dn: cn=extrausers,ou=Group,dc=iihe,dc=tier2,dc=be&lt;br /&gt;
objectClass: posixGroup&lt;br /&gt;
objectClass: top&lt;br /&gt;
cn: extrausers&lt;br /&gt;
gidNumber: 20900&lt;br /&gt;
&lt;br /&gt;
dn: cn=localgrid,ou=Group,dc=iihe,dc=tier2,dc=be&lt;br /&gt;
objectClass: posixGroup&lt;br /&gt;
objectClass: top&lt;br /&gt;
cn: localgrid&lt;br /&gt;
gidNumber: 20501&lt;br /&gt;
&lt;br /&gt;
dn: cn=localusers,ou=Group,dc=iihe,dc=tier2,dc=be&lt;br /&gt;
objectClass: posixGroup&lt;br /&gt;
objectClass: top&lt;br /&gt;
cn: localusers&lt;br /&gt;
gidNumber: 20500&lt;br /&gt;
&lt;br /&gt;
dn: ou=System,dc=tier2,dc=be&lt;br /&gt;
objectClass: top&lt;br /&gt;
objectClass: organizationalUnit&lt;br /&gt;
ou: System&lt;br /&gt;
description: System accounts&lt;br /&gt;
&lt;br /&gt;
dn: uid=syncrepl,ou=System,dc=tier2,dc=be&lt;br /&gt;
uid: syncrepl&lt;br /&gt;
ou: System&lt;br /&gt;
description: Special account for SyncRepl&lt;br /&gt;
objectClass: account&lt;br /&gt;
objectClass: simpleSecurityObject&lt;br /&gt;
&lt;br /&gt;
dn: uid=proxyuser,ou=System,dc=tier2,dc=be&lt;br /&gt;
uid: proxyuser&lt;br /&gt;
ou: System&lt;br /&gt;
objectClass: account&lt;br /&gt;
objectClass: simpleSecurityObject&lt;br /&gt;
description: System account to bind to ldap in readonly mode&lt;br /&gt;
userPassword:: e0NSWUBVfXdCejlQehRaSzFsYzI=&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the command to import this ldif file :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slapadd -v -l test.ldif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note : for security reason, the above ldif file does not give the actual content of our LDAP server. You will find the real content in our restricted area : [https://mon.iihe.ac.be/trac/t2b-iihe/wiki/Tier2LdapServer here]&lt;br /&gt;
&lt;br /&gt;
==== Final check of the service ====&lt;br /&gt;
First, we must start the service :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service ldap start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we can try a few searches through the directory :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ldapsearch -x -D &amp;quot;cn=manager,dc=iihe,dc=ac,dc=be&amp;quot; -W -b &amp;quot;ou=Users,dc=iihe,dc=ac,dc=be&amp;quot;&lt;br /&gt;
ldapsearch -x -D &amp;quot;cn=manager,dc=iihe,dc=ac,dc=be&amp;quot; -W -b &amp;quot;dc=iihe,dc=ac,dc=be&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Procedure describing how to configure an UI for LDAP authentication ===&lt;br /&gt;
&lt;br /&gt;
=== Procedure for the renewal of the LDAP server certificates ===&lt;br /&gt;
Here are the files to update :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TLSCACertificateFile /etc/pki/tls/ldap/certs/ldap01_iihe_ac_be-bundle.pem&lt;br /&gt;
TLSCertificateFile /etc/pki/tls/ldap/certs/ldap01_iihe_ac_be.crt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For your information, here is the private key :&lt;br /&gt;
TLSCertificateKeyFile /etc/pki/tls/ldap/private/ldap01_iihe_ac_be.key&lt;br /&gt;
It should not be changed.&lt;br /&gt;
&lt;br /&gt;
Use the BELNET Web interface to request a new certificate. A request file will be asked. Simply give this file :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ldap01:/root/host_req.pem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(Since we allways reuse the same key, it is not useful to generate a new request.)&lt;br /&gt;
&lt;br /&gt;
Once you have got the new certificates from BELNET, first, make a backup of the old ones :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh root@ldap01 &amp;quot;mv /etc/pki/tls/ldap/certs/ldap01_iihe_ac_be.crt /etc/pki/tls/ldap/certs/ldap01_iihe_ac_be.crt.old&amp;quot;&lt;br /&gt;
ssh root@ldap01 &amp;quot;mv /etc/pki/tls/ldap/certs/ldap01_iihe_ac_be-bundle.pem /etc/pki/tls/ldap/certs/ldap01_iihe_ac_be-bundle.pem.old&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, copy the new ones :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scp ldap01_iihe_ac_be.pem root@ldap01:/etc/pki/tls/ldap/certs/ldap01_iihe_ac_be.crt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How to synchronise accounts on the LDAP server with accounts created by Quattor in flat files ? ===&lt;br /&gt;
Since the LDAP server is not managed by Quattor, accounts have to be synchronised by a &amp;quot;manual&amp;quot; step. To make this task easy, a Perl script has been written (see attachment of this page). Simply launch this script as root on CCQ.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TracNotice|{{PAGENAME}}}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>