如何使用OpenLDAP启用SASL身份验证 - 缺少nsContainer objectClass

问题描述 投票:0回答:1

我正在使用OpenLDAP,在RHEL7和Ubuntu上试用过

# slapd -V
@(#) $OpenLDAP: slapd 2.4.44 (Apr  3 2018 08:03:36) $
    [email protected]:/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

我假设问题是由schema不支持/未定义的属性或objectclass nsContainer

我在/etc/openldap/schema/./etc/openldap/slapd.d/cn\=config/cn\=schema/搜索它。在这两种情况下

grep -rn . -e 'nsContainer'

没有给我什么。没有打。我希望nsContainer被定义在某个地方。由于SASL应该由OpenLDAP核心支持,因此我没有搜索插件。

无论如何。我迷失了,需要帮助。

ubuntu ldap config openldap rhel7
1个回答
2
投票

基本上,您正在尝试将另一个LDAP服务器的特定于供应商的SASL配置数据应用于OpenLDAP的动态配置。无论如何,这绝对不会奏效。

您必须使用OpenLDAP的配置选项,如OpenLDAP 2.4 Admin Guide中所述。

不幸的是,文档仍然描述了静态配置方法。如果您使用的是动态配置方法(也就是cn = config),则必须查阅配置后端的手册页,以获取有关属性olcAuthzRegexp的详细信息。

见:slapd-config(5)

© www.soinside.com 2019 - 2024. All rights reserved.