我正在使用OpenLDAP,已在RHEL7和Ubuntu上尝试过
# slapd -V
@(#) $OpenLDAP: slapd 2.4.44 (Apr 3 2018 08:03:36) $
mockbuild@x86-034.build.eng.bos.redhat.com:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/servers/slapd
# uname -a
Linux xxx-yyy-ldap2 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
或
ldap# uname -a
Linux xxx-ldap2 4.4.0-131-generic #157-Ubuntu SMP Thu Jul 12 15:51:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
root@xxx-ldap2:/etc/ldap#
# slapd -V
@(#) $OpenLDAP: slapd (Ubuntu) (May 22 2018 13:54:12) $
buildd@lcy01-amd64-019:/build/openldap-t_Ta0O/openldap-2.4.42+dfsg/debian/build/servers/slapd
当我尝试按照documentation在运行的服务器上添加SASL映射时,我失败了:
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/changes-sasl-mapping.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=sasl,cn=config"
ldap_add: Invalid syntax (21)
additional info: objectClass: value #1 invalid per syntax
changes-sasl-mapping.ldif
包含:
#root sasl configuration
dn: cn=sasl,cn=config
objectClass: top
objectClass: nsContainer
cn: sasl
#sasl mapping container
dn: cn=mapping,cn=sasl,cn=config
objectClass: top
objectClass: nsContainer
cn: mapping
#sasl mapping node
dn: cn=testmap,cn=mapping,cn=sasl,cn=config
objectclass: top
objectclass: nsSaslMapping
cn: testmap
nsSaslMapRegexString: \(.*\)@\(.*\)\.\(.*\)
nsSaslMapFilterTemplate: (objectclass=inetOrgPerson)
nsSaslMapBaseDNTemplate: uid=\1,ou=Users,dc=\2,dc=\3
我认为问题是由于架构不受支持/未定义属性或对象类nsContainer
。
我在/etc/openldap/schema/.
和/etc/openldap/slapd.d/cn\=config/cn\=schema/
中进行了搜索。两种情况下
grep -rn . -e 'nsContainer'
什么也没给我。没有命中我希望nsContainer
被定义在某个地方。由于OpenLDAP内核应支持SASL,因此我没有在搜索插件。
无论如何。我迷路了,需要帮助。
答案 0 :(得分:2)
基本上,您正在尝试将另一台LDAP服务器的特定于供应商的SASL配置数据应用于OpenLDAP的动态配置。无论如何,这绝对是行不通的。
您必须使用OpenLDAP 2.4 Admin Guide中所述的OpenLDAP的配置选项。
不幸的是,文档仍然描述了静态配置方法。如果使用动态配置方法(又名 cn = config ),则必须查阅配置后端的手册页以获取有关属性 olcAuthzRegexp 的详细信息。
请参阅:slapd-config(5)