
Introduction
LDAP stands for Lightweight Directory Access Protocoland, as the name suggests, it’s a standard protocol for accessing and maintaining distributed directory information services over an IP network.
In this tutorial, we’ll install a LDAP server on Centos 7 using 389 Directory Server.
Getting startedFirst of all, configure FQDN in /etc/hosts .
In that file, put the server’s fully qualified domain name.
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
X.X.X.X yoursever.hostname.lan server
Of course, substitue the last line in this example with your server’s informations.
Configure firewallAs you may know, we need to allow LDAP server’s default ports via firewall in order to access it from a remote system.
So:
firewall-cmd --permanent --add-port=389/tcp firewall-cmd --permanent --add-port=636/tcp firewall-cmd --permanent --add-port=9830/tcpNow, restart firewalld service.
firewall-cmd --reload Create an user accountNow, create a new user.
useradd ldapuserand set a password
passwd ldapuserRestart CentOS.
Install LDAP ServerNote: you need to have EPEL repository.
Install 389 DS server:
yum install 389-ds-base 389-adminAfter installing it, it’s time to configure:
setup-ds-admin.pl ConclusionAt this point, you have installed and configured everything. You can, of course, tweak something, and, for example, enable directory server and directory admin services automatically on every reboot. It’s up to you!