OpenLDAP 客户端配置

1.客户端配置参考地址:

点击访问官方客户端配置地址

2. 一般配置文件会配置于两个地方:
系统文件: /etc/openldap/ldap.conf
用户文件:$HOME/ldaprc, $HOME/.ldaprc
注意: .ldaprc 优先级要高于 ldap.conf

3. 配置文件 ldap.conf 参数说明

ldapsearch -x -W -D 'cn=fooheradmin,dc=fooher,dc=com' -b "dc=fooher,dc=com" -H ldap://10.25.10.36

4.修改配置文件 ldap.conf

/bin/cp /etc/openldap/ldap.conf{,_bak}
sudo tee /etc/openldap/ldap.conf <<-EOF
#
# LDAP Defaults
#
BASE    dc=fooher,dc=com
URI     ldap://10.25.10.36

SIZELIMIT   2
#TIMELIMIT  15
#DEREF      never

TLS_CACERTDIR   /etc/openldap/certs
SASL_NOCANON    on
EOF
ldapsearch -x -W -D 'cn=fooheradmin,dc=fooher,dc=com'
Enter LDAP Password:
# extended LDIF
#
# LDAPv3
# base  (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# fooher.com
dn: dc=fooher,dc=com
objectClass: dcObject
objectClass: organization
o: https://www.fooher.com
dc: fooher

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1