在Debian 6(或Ubuntu 12.04)上新鲜的OpenLDAP安装,我想从现代的cn=config风格切换到传统的slapd.confconfiguration。 我听说,这是可能的,但到目前为止,我还没有find一个描述,如何做或教程。
我该怎么做,或者我可以在哪里看?
好的,我发现了。 请注意,我是在全新安装的情况下做的,所以没有任何数据丢失的危害。 如果你在生产系统上这样做,确保你可以回滚:)
所以,在Debian 6上,你可以这样做:
service slapd stop # stop the service mv /etc/ldap/slapd.d /root # move the cn=config configuration cp /usr/share/slapd/slapd.conf /etc/ldap/ # get new sample config # make changes to sample config so that it can work sed -i "s/@BACKEND@/hdb/" /etc/ldap/slapd.conf sed -i "s/@SUFFIX@/dc=acme,dc=org/" /etc/ldap/slapd.conf sed -i "s/# rootdn/rootdn/" /etc/ldap/slapd.conf # manually execute "slappasswd" on the command line to generate a root pw # then add the following line (without "#") after rootdn # rootpw <crypted password> sed -i "s/@ADMIN@/cn=admin,dc=acme,dc=org/" /etc/ldap/slapd.conf mv /var/lib/ldap/* /root # remove old config database service slapd start # start service again
进一步的configuration可能是不安全的,但是这给你一个系统,你可以通过传统的slapd.confconfiguration