安装OpenLDAP
# yum -y install openldap openldap-servers openldap-clients
# cd /etc/openldap
# mv slapd.d slapd.d.bak
# cp /usr/share/openldap-servers/slapd.conf.obsolete slapd.conf
# slappasswd
# slappasswd
# vi slapd.conf
修改cn和dc,创建管理员密码,尽量使用slappasswd生成的密码:
rootpw {SSHA}VJbYu8MTmEV7N4PoQfDXiC2gM5bfbXKL
# chown ldap.ldap slapd.conf
开机启动OpenLDAP
# chkconfig slapd on
添加防火墙端口
# /etc/init.d/iptables stop
# /sbin/iptables -I INPUT -p tcp --dport 389 -j ACCEPT
# /etc/rc.d/init.d/iptables save
# /etc/init.d/iptables status
# /etc/init.d/iptables restart
将SELinux设置成警告模式
# setenforce 0
永久关闭SELinux
# vi /etc/selinux/config
将SELINUX=enforcing 改为:SELINUX=disable