OpenLDAP : LDAP over SSL/TLS2021/05/17 |
Configure LDAP over SSL/TLS to use secure encrypted connection.
|
|
[1] | |
[2] | Configure LDAP Server. |
root@dlp:~#
cp /etc/ssl/private/server.key \ /etc/ssl/private/server.crt \ /etc/ssl/certs/ca-certificates.crt \ /etc/ldap/sasl2/ root@dlp:~# chown openldap. /etc/ldap/sasl2/server.key \
/etc/ldap/sasl2/server.crt \ /etc/ldap/sasl2/ca-certificates.crt
root@dlp:~#
vi mod_ssl.ldif # create new dn: cn=config changetype: modify add: olcTLSCACertificateFile olcTLSCACertificateFile: /etc/ldap/sasl2/ca-certificates.crt - replace: olcTLSCertificateFile olcTLSCertificateFile: /etc/ldap/sasl2/server.crt - replace: olcTLSCertificateKeyFile olcTLSCertificateKeyFile: /etc/ldap/sasl2/server.key 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"root@dlp:~# systemctl restart slapd
|
[3] | Configure LDAP Client. If you'd like to make sure the connection between LDAP server and client is encrypted, use tcpdump or other network capture software on LDAP server. |
root@node01:~#
vi /etc/nslcd.conf # line 29 : add ssl start_tls tls_reqcert allow node01 login: hirsute # LDAP user Password: Welcome to Ubuntu 21.04 (GNU/Linux 5.11.0-16-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage System information as of Mon May 17 01:29:55 AM UTC 2021 System load: 0.08 Memory usage: 5% Processes: 126 Usage of /: 32.4% of 19.56GB Swap usage: 0% Users logged in: 0 ..... ..... Last login: Mon May 17 01:29:02 UTC 2021 on ttyS0 hirsute@node01:~$ # logined |
Sponsored Link |