ldap server 为CentOS release 6.4
1、yum install *openldap*,rpm包网站
http://rpmfind.net/linux/rpm2html/search.php?query=openldap&submit=Search+...&system=centos&arch=
2、cp /usr/share/openldap-servers/slapd.conf.obsolete slapd.conf
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/DB_CONFIG
3、slappasswd 生成LDAP管理员的密码并记录下来,如{SSHA}CPlvLh997/PJbKtcw6aelERbVi5Tp9np
4、server配置文件的修改:
vim /etc/openldap/slapd.conf
# enable server status monitoring (cn=monitor)
database monitor
access to *
by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" read
by dn.exact="cn=admin,dc=example,dc=com" read
by * none
#######################################################################
# database definitions
#######################################################################
database bdb
suffix "dc=example,dc=com"
checkpoint 1024 15
rootdn "cn=admin,dc=example,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw secret
# rootpw {crypt}ijFYNcSNctBYg
rootpw {SSHA}CPlvLh997/PJbKtcw6aelERbVi5Tp9np
5、生成服务端的配置,
rm -rf /etc/openldap/slapd.d/*
slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
ldapserver是用自己的用户ldap进行操作的。要将所有的ldap的目录属组进行修改:
chown -R ldap:ldap /etc/openldap/slapd.d
chown -R ldap:ldap /var/lib/ldap
#service slapd restart
以上就是ldap服务端的配置。