- 论坛徽章:
- 0
|
环境:
操作系统:CentOS release 6.5 (Final)
openldap版本:
[root@test openldap]# rpm -qa|grep openldap
openldap-clients-2.4.39-8.el6.x86_64
openldap-2.4.39-8.el6.x86_64
openldap-servers-sql-2.4.39-8.el6.x86_64
openldap-devel-2.4.39-8.el6.x86_64
openldap-servers-2.4.39-8.el6.x86_64
安装过程如下:
1.cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.conf
2. cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
3. 修改 /etc/openldap/slapd.conf,修改内容下:
suffix "dc=xxx,dc=com"
rootdn "cn=Manager,dc=xxx,dc=com"
rootpw {SSHA}efwD836KFV7bq80/KFQ3piXYc6j90QdF
上述配置文件中的{SSHA}efwD836KFV7bq80/KFQ3piXYc6j90QdF是通过slappasswd,输入redhat生成的。
4. rm -rf /etc/openldap/slapd.d/*
5. slaptest -v -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d/
6. chown -R ldap.ldap /etc/openldap/*
chown -R ldap.ldap /var/lib/ldap/*
7. 修改配置文件/etc/openldap/slapd.d/cn=config/olcDatabase={1}monitor.ldif
内容如下:
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=externa
l,cn=auth" read by dn.base="cn=Manager,dc=xxx,dc=com" read by * none
7. service slapd restart
8.运行命令
ldapadd -x -W -D "cn=Manager,dc=xxx,dc=com" -f /etc/openldap/example.ldif
输入redhat后出现ldap_bind: Invalid credentials (49)。
后修改配置文件/etc/openldap/slapd.d/cn=config/olcDatabase={2}bdb.ldif中的olcRootPW:{SSHA}nF3jVnyz55sgok6Mep02Cg1rRh0f01FI,olcRootPW:后面的内容用了自动生成、明文、密文几种格式,允许上述命令,试了各种密码,都出现ldap_bind: Invalid credentials (49),弄了几天没有出来,请大虾帮帮我。
|
|