Debian 13 trixie

OpenLDAP : LDAP over SSL/TLS2025/09/05

 

LDAP over SSL/TLS を設定し、LDAP サーバーとクライアント間の通信をよりセキュアにします。

[1]

当例ではリンク先の例の通り、LDAP サーバー側で自己署名の証明書を作成して進めます。

[2] LDAP サーバー側で [1] で作成した証明書をコピーして SSL/TLS の設定をします。
root@dlp:~#
cp /etc/ssl/private/server.key \
/etc/ssl/private/server.crt \
/etc/ldap/sasl2/

root@dlp:~#
chown openldap:openldap /etc/ldap/sasl2/server.key \
/etc/ldap/sasl2/server.crt
root@dlp:~#
vi mod_ssl.ldif
# 新規作成

dn: cn=config
changetype: modify
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/ldap/sasl2/server.crt
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/ldap/sasl2/server.key

root@dlp:~#
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] LDAP クライアント側の設定です。
通信内容が正常に暗号化されているかを確認する場合は、サーバー側で tcpdump 等を活用するとよいでしょう。
root@node01:~#
vi /etc/nslcd.conf
# 29行目 : 追記

ssl start_tls
tls_reqcert allow
root@node01:~#
systemctl restart nslcd

root@node01:~#
node01 login: trixie     # LDAP 登録ユーザー
Password:
Linux node01.srv.world 6.12.41+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.41-1 (2025-08-12) 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.
trixie@node01:~$      # ログインできた
関連コンテンツ