LDAP stands for Lightweight Directory Access Protocol. It is used in enterprise network for Authentication Purposes. There are two types of LDAP server mainly configured as a Master and Slave LDAP Server. In this Tutorial we are going to configure the master and slave LDAP Server with step by step instructions.

Master and Slave LDAP Server

Full Details for configuring the LDAP Server by following the given instructions.

Step-1 (Provide the slave ldap entry in master)

# vi /etc/openldap/slapd.conf
 Replog file /var/lib/ldap/slapd.conf
 Replica host = ldapslave.techbrown.com
 binddn = “cn = manager, dc = techbrown, dc = com”
 suffix = dc = techbrown, dc = com
 credentials = a
 bindmethod = simple
 hs = no

: wq (save & quite)

Also Read  How to configure Dynamic DNS Server on CentOS 7 / RHEL 8

Step-2 (Assign the Hostname)

 # host name slaveldap.techbrown.com
 # host name
 # ipconfig
 # vi /etc/host
 192.168.0.200 slaveldap.techbrown.com slave ldap

: wq (save & quite)

# vi /etc/sysconfig/network
 HOSTNAME = slaveldap.techbrown.com

:wq (to save & quite)

Step-3 (Install the package’s)

 # yum install openldap* *db* -y
 # scp -rv 192.168.0.100 : /etc/openldap/techbrown.comldif /etc/openldap/

Step-4 (Open the M.C.F)

 # vi /etc/openldap/slapd.conf
 # chown ldap : ldap DB_CONFIG

Step-5 (Provide the master ldap entery in slave host file)

 # vi /etc/hosts
 192.168.0.100 ldap.techbrown.com ldap

: wq (to save & quit)

Step-6 (In slave ldap server)

 # service ldap restart
 suffix “dc = techbrown.dc = com”
 rootdn “on=manager, dc=techbrown, dc=com”
 password root ********

:wq (save & quit)
Then come end of file

update ref ldap://ldap.techbrown.com (master ldap name)
update dn “on=manager, dc=techbrown, dc = com”

:wq (save & quit)
Copy Data base file into /var/lib/ldap

 # cd /etc/openldap
 # ls
 # cp DB_CONFIG_example /var/lib/ldap
 # cd /var/lib/ldap (to enter the dir)
 # ls (to check)
 # mv DB_CONFIG.example DB_CONFIG (to rename)
 # ls

Step-7 (In Master LDAP Server)

Then move the master ldap server

# service ldap restart

Then create a ldap user in ldap database and move to slave ldap server

# ldap search -x -b “dc=techbrown, dc=com” ‘(object class=*)’

Step-8 (To Check in Client System)

# authconfig-tui

after opening authconfig-tui follow the given steps —> ldap —>server IP —->Domain Name.

Congratulations now you have configured the master and slave LDAP server on CentOS and RHEL.

Also Read  How to Add Google to Firefox on Linux Mint as Default Search Engine