有没有办法使用LDAP的基于DN的组之一的Linux组,而不是使用基于uid的posixGroup objectclass?
更广泛地说,有什么办法可以避免拥有一组用于支持Linux帐户的组和一组其他所有组使用的并行组?
是。
在你的nss_ldapconfiguration文件中,设置nss_schema:
nss_schema rfc2307bis
在架构中的服务器上,确保posixGroup对象类是辅助的而不是结构的。
然后,可以为每个组使用groupofmember(new)或groupofnames(old)和posixgroup objectclass。 每个成员将成为一个成员属性:
dn: cn=foo,ou=Groups,dc=example objectclass: top objectclass: posixgroup objectclass: groupofmembers gidnumber: 9234 member: uid=bob,ou=people,dc=example member: uid=alice,ou=people,dc=example
要获得groupOfMembers模式,你可以从rfc中提取它 ,或者使用这个已经完成的工作,并将其保存到/etc/openldap/schema/rfc2307bis.schema 。 这个模式取代了nis模式,所以先删除那个模式。
cn=config后端 convert-schema.conf的文件
包括/etc/openldap/schema/core.schema 包括/etc/openldap/schema/cosine.schema 包括/etc/openldap/schema/rfc2307bis.schema
/tmp/converted的目录 slaptest -f convert-schema.conf -F /tmp/convert/
slaptest成功 /tmp/convert/cn=config/cn=schema/cn={2}rfc2307bis.ldif复制到/etc/openldap/rfc2307bis.ldif rfc2307bis.ldif
dn: cn=rfc2307bis,cn=schema,cn=config cn: rfc2307bis structuralObjectClass到modifyTimestamp ) ldapadd -f rfc2307bis.ldif -D "cn=admin,cn=config" -W