2022
我们一起努力

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

openldap中如何配置SSL/TLS加密通信!,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

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系统配置,开启ldaps

#vim /etc/sysconfig/ldap

SLAPD_LDAP=no ######根据自己需要进行配置,这里关掉

SLAPD_LDAPI=no ######根据自己需要进行配置,这里关掉

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

SLAPD_LDAPS=yes

 

5,服务器启动服务&配置自启动

# service slapd stop #先关闭

rm -rf /etc/openldap/slapd.d/* ##第一次安装时需要执行这个步骤,如果ldap服务已经配置好,只是更改ldap协议为ldaps协议,不需要执行此步骤。

# 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!

看完上述内容,你们掌握openldap中如何配置SSL/TLS加密通信!的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注云行业资讯频道,感谢各位的阅读!

赞(0)
文章名称:《openldap中如何配置SSL/TLS加密通信》
文章链接:https://www.fzvps.com/112130.html
本站文章来源于互联网,如有侵权,请联系管理删除,本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
图片版权归属各自创作者所有,图片水印出于防止被无耻之徒盗取劳动成果的目的。

评论 抢沙发

评论前必须登录!