CentOS 7
Sponsored Link

LDAP over TLS
2015/03/18
 
Configure LDAP over TLS to make connection be secure.
[1]
[2] Configure LDAP Server.
[[email protected] ~]#
cp /etc/pki/tls/certs/server.key \
/etc/pki/tls/certs/server.crt \
/etc/pki/tls/certs/ca-bundle.crt \
/etc/openldap/certs/

[[email protected] ~]#
chown ldap. /etc/openldap/certs/server.key \
/etc/openldap/certs/server.crt \
/etc/openldap/certs/ca-bundle.crt
[[email protected] ~]#
vi mod_ssl.ldif
# create new

dn: cn=config
changetype: modify
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/openldap/certs/ca-bundle.crt
-
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/openldap/certs/server.crt
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/openldap/certs/server.key

[[email protected] ~]#
ldapmodify -Y EXTERNAL -H ldapi:/// -f mod_ssl.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"

[[email protected] ~]#
vi /etc/sysconfig/slapd
# line 9: add

SLAPD_URLS="ldapi:/// ldap:///
ldaps:///
"
[[email protected] ~]#
systemctl restart slapd

[3] Configure LDAP Client for TLS connection.
[[email protected] ~]#
echo "TLS_REQCERT allow" >> /etc/openldap/ldap.conf

[[email protected] ~]#
echo "tls_reqcert allow" >> /etc/nslcd.conf

[[email protected] ~]#
authconfig --enableldaptls --update

getsebool: SELinux is disabled
[[email protected] ~]#
logout
CentOS Linux 7 (Core)
Kernel 3.10.0-123.20.1.el7.x86_64 on an x86_64
www login:
redhat

Password:
Last login: Tue Aug 19 19:55:52 on ttyS0
[[email protected] ~]$
# logined normally