OpenLDAP : LDAP over SSL/TLS2019/07/26 |
Configure LDAP over SSL/TLS to make connection be secure.
|
|
[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" |
[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@www:~#
echo "TLS_REQCERT allow" >> /etc/ldap/ldap.conf
root@www:~#
vi /etc/pam_ldap.conf # line 258: uncomment ssl start_tls
root@www:~#
vi /etc/libnss-ldap.conf # line 291: uncomment ssl start_tls
root@www:~#
logout www login: buster # LDAP user Password: Last login: Fri Jul 26 14:07:43 JST 2019 on ttyS0 Linux www.srv.world 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5 (2019-06-19) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. buster@www:~$ # logined |
Sponsored Link |