Debian 8 Jessie
Sponsored Link

LDAP over TLS2015/05/10

 
LDAP over TLS を設定し、LDAP サーバーとクライアント間の通信をよりセキュアにします。
[1]
まずはこちらを参照して SSL 証明書を作成しておきます。
[2] LDAP サーバーの設定です。
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
# 新規作成

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

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:~#
vi /etc/default/slapd
# 24行目:追記

SLAPD_SERVICES="ldap:/// ldapi:///
ldaps:///
"
root@dlp:~#
systemctl restart slapd

[3] LDAP クライアントの設定です。
root@www:~#
echo "TLS_REQCERT allow" >> /etc/ldap/ldap.conf

root@www:~#
vi /etc/libnss-ldap.conf
# 291行目:コメント解除

ssl start_tls
root@www:~#
vi /etc/pam_ldap.conf
# 258行目:コメント解除

ssl start_tls
root@www:~#
logout
Debian GNU/Linux 8 www.srv.world ttyS0
www login:
debian

Password:
Last login: Mon May 11 15:54:41 JST 2015 on ttyS0
Linux www.srv.world 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24) 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.
debian@www:~$    
# ログインできた
関連コンテンツ