16.9. 为用户和组群同步 POSIX 属性
所有可能用户和属性的子集在 Active Directory 和 Red Hat Directory Server 之间同步。某些属性会被映射,Active Directory 和 Directory Server 模式之间存在不同,一些属性会被直接匹配。同步的属性(匹配和映射)列在 第 16.5.1 节 “在 Directory 服务器和 Active Directory 之间同步的用户属性” 和 第 16.6.2 节 “目录服务器和 Active Directory 之间的组属性” 中。
默认情况下,只有这些属性会被同步。
该同步列表中缺少的一个属性是任何与 POSIX 相关的属性。在 Linux 系统上,系统用户和组被识别为 POSIX 条目,而 LDAP POSIX 属性则包含所需信息。但是,当 Windows 用户同步时,它们会自动添加
ntUser
和 ntGroup
属性,以将其识别为 Windows 帐户,但没有与 Windows 帐户同步(即使它们存在于 Active Directory 条目中),并且 Directory Server 上没有添加 POSIX 属性。
Posix Winsync API 插件在 Active Directory 和 Directory Server 条目之间同步 POSIX 属性。
注意
所有 POSIX 属性(如
uidNumber
、gidNumber
和 homeDirectory
)都在 Active Directory 和 Directory Server 条目之间同步。但是,如果新的 POSIX 条目或 POSIX 属性添加到 Directory 服务器中的现有条目中,则只有 POSIX 属性同步到 Active Directory 对应的条目。POSIX 对象类(posixAccount 用于用户,posixGroup 用于组)不会添加到 Active Directory 条目中。
16.9.1. 启用 POSIX 属性同步 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Posix Winsync API 插件默认为禁用,且必须启用 POSIX 属性才能从 Active Directory 用户和组条目同步到对应的目录服务器条目。
启用 Posix Winsync API 插件:
- 启用插件:
dsconf -D "cn=Directory Manager" ldap://server.example.com plugin "cn=Posix Winsync API,cn=plugins,cn=config" enable
# dsconf -D "cn=Directory Manager" ldap://server.example.com plugin "cn=Posix Winsync API,cn=plugins,cn=config" enable
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 重启实例:
dsctl instance_name restart
# dsctl instance_name restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
16.9.2. 更改 Posix 组属性同步设置 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
可以设置多个插件属性,以控制 POSIX 组属性和组成员如何从 Active Directory 条目同步到对应的 Directory Server 组和用户条目。详情请查看 红帽目录服务器配置、命令和文件参考中的相应部分。
默认设置可用于大多数部署,但可以根据 Active Directory 环境更改设置。例如,启用嵌套组映射:
- 使用以下命令启用嵌套组映射:
dsconf -D "cn=Directory Manager" ldap://server.example.com plugin posix-winsync set --map-nested-grouping="true"
# dsconf -D "cn=Directory Manager" ldap://server.example.com plugin posix-winsync set --map-nested-grouping="true"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 重启 Directory 服务器以加载新配置。
dsctl instance_name restart
# dsctl instance_name restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
如果 Directory 服务器和 Active Directory (AD)上的
posixGroup
条目中的 member
和 uniqueMember
属性值不匹配,请使用 dsconf plugin posix-winsync fixup 命令来解决这个问题:
dsconf -D "cn=Directory Manager" ldap://server.example.com plugin posix-winsync fixup DN
# dsconf -D "cn=Directory Manager" ldap://server.example.com plugin posix-winsync fixup DN
此命令在 Directory 服务器上重新创建
memberUid
值,并自动修改 member
和 uniqueMember
属性值,以匹配 AD 中定义的值。
(可选)将
-f filter
参数传递给命令,以指定命令应修复 memberUid
属性的条目。如果没有过滤器,命令可以在包含 inetuser、inetadmin 和 nsmemberof 对象类的所有条目上运行。