1.3. 为静态组添加成员
您可以使用 web 控制台的命令行将成员添加到组中。
1.3.1. 使用命令行将成员添加到静态组中 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
要将成员添加到静态组中,请使用 ldapmodify 工具。
先决条件
- 组条目存在。
- 存在用户条目。
流程
要将成员添加到带有
groupOfNames对象类的静态组中,请将用户可分辨名称(DN)作为值添加到 group 条目的member属性中:# ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x dn: cn=simple_group,ou=groups,dc=example,dc=com changetype: modify add: member member: uid=jsmith,ou=people,dc=example,dc=com modifying entry "cn=simple_group,ou=groups,dc=example,dc=com"命令将
uid=jsmith用户添加到cn=simple_group组中。要将成员添加到带有
groupOfUniqueNames对象类的静态组中,请将用户可分辨名称(DN)作为值添加到组条目的uniqueMember属性中:# ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x dn: cn=unique_members_group,ou=groups,dc=example,dc=com changetype: modify add: uniqueMember uniqueMember: uid=ajonson,ou=people,dc=example,dc=com modifying entry "cn=unique_members_group,ou=groups,dc=example,dc=com"命令将
uid=ajonson用户添加到cn=unique_members_group组中。
验证
列出组成员:
# ldapsearch -xLL -D "cn=Directory Manager" -W -b dc=example,dc=com "(cn=simple_group)" dn: cn=simple_group,ou=Groups,dc=example,dc=com objectClass: top objectClass: groupOfNames objectClass: nsMemberOf cn: simple_group member: uid=jsmith,ou=people,dc=example,dc=com member: uid=mtomson,ou=people,dc=example,dc=com
1.3.2. 在 LDAP 浏览器中将成员添加到静态组中 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
您可以使用 LDAP 浏览器将成员添加到 Web 控制台中的静态组中。
先决条件
- 组条目存在。
- 用户条目存在。
- 在 web 控制台中登录到实例。有关登录到 Web 控制台的详情,请参阅使用 Web 控制台登录到目录服务器。
流程
- 导航到 LDAP 浏览器 菜单。
-
使用 Tree 或 Table 视图,展开您要添加成员的组条目。例如,您要向
cn=unique_members_group,ou=groups,dc=example,dc=com添加一个成员。 - 点 Options 菜单(3.3.0)并选择 以打开向导窗口。窗口中显示当前成员列表。
- 选择 Find New Members 选项卡。
-
在搜索栏中输入成员的
uid或cn属性值的一部分,然后按 键。Available Members 字段显示您可以添加到组的用户可区分名称(DN)。 - 选择成员 DN 并将其移到 Chosen Members 字段。
- 点 按钮。
验证
-
展开
cn=unique_members_group,ou=groups,dc=example,dc=com组条目,并在条目详情中找到添加的用户。