Ubuntu上安装Open LDAP

来源:互联网 发布:我赢职场的java视频 编辑:程序博客网 时间:2024/04/27 20:32

安装 Ubuntu的官方的介绍安装OpenLDAP

https://help.ubuntu.com/lts/serverguide/openldap-server.html

碰见Base DN始终设定不成功,来来回回试了半天最终设定好了。整理一下步骤

1. 修改/etc/hosts文件,增加 127.0.1.1 hostname.example.com hostname行,其中example.com为Base DB dc=example,dc=com

127.0.1.1       hostname.example.comhostname

2.安装slapd ldap-utils

sudo apt-get install slapd ldap-utils

3.安装官方文档上述两步后已经配置好了Base DN, 但是我安装完之后Base DN仍然找不到

正常的结果应该为:

sudo ldapsearch -x -LLL -H ldap:/// -b dc=example,dc=com dndn: dc=example,dc=comdn: cn=admin,dc=example,dc=com

但是我执行的结果是 no object.

4. 执行dpkg-reconfiure 重新配置sladp的Base DN

参考http://www.codeden.net/2012/04/how-to-setup-ldap-on-ubuntu/ 的第二部重新配置Base DN

sudo dpkg-reconfigure slapd

#注意:配置过程中第一个BaseDN的输入应该是"example.com" 不是 "dc=example,dc=com" 也不是“hostname.example.com"


5. 重新配置好之后再次运行Step3的命令确认Base DN是否安装成功

#不能确认修改/usr/share/slapd/slapd.conf是否为必须步骤。我是将slapd.conf的suffix = "@SUFFIX" 修改为 suffix ="dc=example,dc=com"



0 0
原创粉丝点击