溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

openldap中如何配置SSL/TLS加密通信

發(fā)布時間:2021-12-14 17:33:29 來源:億速云 閱讀:501 作者:柒染 欄目:云計算

openldap中如何配置SSL/TLS加密通信!,相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。

1,ldap服務器自制簽名&證書

ldap服務器安裝ldap:yum install -y openldap openldap-servers openldap-clients migrationtools openssl

#cd /etc/openldap/certs/

# openssl genrsa -out ldap.key 1024 //私鑰

# openssl req -new -key ldap.key -out ldap.csr //生成簽名請求

# openssl x509 -req -days 1095 -in ldap.csr -signkey ldap.key -out ldap.crt //公鑰 自簽名

###########ldap.key(私鑰)、ldap.crt(證書、公鑰)############

2,返回上級目錄,對cert設置權限:

# chmod 700 certs/

# chown -R ldap.ldap certs/

3,修改ldap服務器配置文件 /etc/openldap/certs/ldap.conf 、 /etc/openldap/certs/sldap.conf文件。

# vim /etc/openldap/ldap.conf

TLS_CACERTDIR /etc/openldap/certs

TLS_REQCERT allow

URI ldaps://http://xxx.xxx.xxx.xxx ###配置URI

BASE dc=xxx,dc=xxxx ###設置為ldap的域名

##################################

# vim /etc/openldap/slapd.conf

TLSCACertificatePath /etc/openldap/certs

TLSCertificateFile /etc/openldap/certs/ldap.crt

TLSCertificateKeyFile /etc/openldap/certs/ldap.key

4,修改本地ldap系統(tǒng)配置,開啟ldaps

#vim /etc/sysconfig/ldap

SLAPD_LDAP=no ######根據(jù)自己需要進行配置,這里關掉

SLAPD_LDAPI=no ######根據(jù)自己需要進行配置,這里關掉

SLAPD_LDAPS=yes


 

5,服務器啟動服務&配置自啟動

# service slapd stop #先關閉

rm -rf /etc/openldap/slapd.d/* ##第一次安裝時需要執(zhí)行這個步驟,如果ldap服務已經(jīng)配置好,只是更改ldap協(xié)議為ldaps協(xié)議,不需要執(zhí)行此步驟。

# slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d/

# chown -R ldap.ldap /etc/openldap/slapd.d/

# service slapd start #開啟

配置自啟動:

#chkconfig slapd on

6,客戶端配置及測試

客戶端機器安裝openldap-clients openldap

更改客戶端配置文件

# vim /etc/openldap/ldap.conf

TLS_CACERTDIR /etc/openldap/certs

TLS_REQCERT allow

URI ldaps://http://xxx.xxx.xxx.xxx ###配置URI

BASE dc=xxx,dc=xxxx ###設置為ldap的域名

##################################

測試:

#ldapsearch -x -W -D "cn=Manager,dc=test,dc=com" -b "dc=test,dc=com" - H ldaps://xxxxxx

輸入密碼,ok!

看完上述內(nèi)容,你們掌握openldap中如何配置SSL/TLS加密通信!的方法了嗎?如果還想學到更多技能或想了解更多相關內(nèi)容,歡迎關注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI