1、 OpenLDAP安装与配置
在集群中选择一台服务器作为OpenLDAP的Server
1.1 执行如下命令安装OpenLDAP服务
# yum -y install openldap-clients openldap-devel openldap-servers migrationtools sssd authconfig nss-pam-ldapd
1.2 初始化OpenLDAP服务的配置文件
# cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.conf
# cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
# chown -R ldap:ldap /var/lib/ldap/
# rm -rf /etc/openldap/slapd.d/*
1.3 使用slappasswd命令生成密文密码:Aojf+pupuni123
# slappasswd
New password: Aojf+pupuni123
Re-enter new password: Aojf+pupuni123
{SSHA}rLGjgey/FAn63/3LuGLLAFRGF0edKN3U
注意
:此处生成的密码:{SSHA}rLGjgey/FAn63/3LuGLLAFRGF0edKN3U,在第四步配置文件中使用。
1.4 修改/etc/openldap/slapd.conf配置文件
注释配置文件中的如下内容
# TLSCACertificatePath /etc/openldap/certs
# TLSCertificateFile "\"OpenLDAP Server\""
# TLSCertificateKeyFile /etc/openldap/certs/password
# 修改database monitor配置
# 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=Manager,dc=pupu,dc=com" read
by * none
# 修改database definitions配置
#######################################################################
# database definitions
#######################################################################
database bdb
suffix "dc=pupu,dc=com"
checkpoint 1024 15
rootdn "cn=Manager,dc=pupu,dc=com"
rootpw {SSHA}rLGjgey/FAn63/3LuGLLAFRGF0edKN3U
注意
:rootpw属性必须顶格写
1.5 先启动slapd再停止slapd服务,初始化数据库文件
#