Chapter 43. Managing host groups using the IdM CLI
Manage host groups and their members in Identity Management (IdM) using the CLI to organize hosts for easier policy management. Host groups simplify the application of access control rules and other policies to multiple hosts.
43.1. Host groups in IdM Copy linkLink copied to clipboard!
Understand how IdM host groups centralize control over access policies and other management tasks for sets of hosts with common characteristics. For example, you can define host groups based on company departments, physical locations, or access control requirements.
A host group in IdM can include:
- IdM servers and clients
Other IdM host groups
- Host groups created by default
-
By default, the IdM server creates the host group
ipaserversfor all IdM server hosts. - Direct and indirect group members
- Group attributes in IdM apply to both direct and indirect members: when host group B is a member of host group A, all members of host group B are considered indirect members of host group A.
43.2. Viewing IdM host groups using the CLI Copy linkLink copied to clipboard!
View host groups and their details by using the Identity Management (IdM) CLI to understand how hosts are organized and confirm group configurations.
Prerequisites
- Administrator privileges for managing IdM or User Administrator role.
- An active Kerberos ticket. For details, see Using kinit to log in to IdM manually.
Procedure
Find all host groups using the
ipa hostgroup-findcommand.Copy to Clipboard Copied! Toggle word wrap Toggle overflow To display all attributes of a host group, add the
--alloption. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
43.3. Creating IdM host groups using the CLI Copy linkLink copied to clipboard!
Create host groups using the Identity Management (IdM) CLI to organize and manage multiple hosts as a single unit. Host groups simplify policy application and administrative tasks across your infrastructure.
Prerequisites
- Administrator privileges for managing IdM or User Administrator role.
- An active Kerberos ticket. For details, see Using kinit to log in to IdM manually.
Procedure
Add a host group using the
ipa hostgroup-addcommand.For example, to create an IdM host group named group_name and give it a description:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
43.4. Deleting IdM host groups using the CLI Copy linkLink copied to clipboard!
You can delete host groups using the Identity Management (IdM) CLI. Deleting a host group does not delete the group members from IdM.
Prerequisites
- Administrator privileges for managing IdM or User Administrator role.
- An active Kerberos ticket. For details, see Using kinit to log in to IdM manually.
Procedure
Delete a host group using the
ipa hostgroup-delcommand.For example, to delete the IdM host group named group_name:
ipa hostgroup-del group_name -------------------------- Deleted hostgroup "group_name" --------------------------
$ ipa hostgroup-del group_name -------------------------- Deleted hostgroup "group_name" --------------------------Copy to Clipboard Copied! Toggle word wrap Toggle overflow
43.5. Adding IdM host group members using the CLI Copy linkLink copied to clipboard!
Add hosts to host groups using the Identity Management (IdM) CLI to apply policies and access controls to multiple systems collectively.
Prerequisites
- Administrator privileges for managing IdM or User Administrator role.
- An active Kerberos ticket. For details, see Using kinit to log in to IdM manually.
-
Optional: Use the
ipa hostgroup-findcommand to find hosts and host groups.
Procedure
To add a member to a host group, use the
ipa hostgroup-add-membercommand and provide the relevant information. You can specify the type of member to add using these options:Use the
--hostsoption to add one or more hosts to an IdM host group.For example, to add the host named example_member to the group named group_name:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
--hostgroupsoption to add one or more host groups to an IdM host group.For example, to add the host group named nested_group to the group named group_name:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can add multiple hosts and multiple host groups to an IdM host group in one single command using the following syntax:
ipa hostgroup-add-member group_name --hosts={host1,host2} --hostgroups={group1,group2}$ ipa hostgroup-add-member group_name --hosts={host1,host2} --hostgroups={group1,group2}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
ImportantWhen adding a host group as a member of another host group, do not create recursive groups. For example, if Group A is a member of Group B, do not add Group B as a member of Group A. Recursive groups can cause unpredictable behavior.
43.6. Removing IdM host group members using the CLI Copy linkLink copied to clipboard!
Remove hosts or nested host groups from an Identity Management (IdM) host group by using the CLI to revoke their membership-based policies and access.
Prerequisites
- Administrator privileges for managing IdM or User Administrator role.
- An active Kerberos ticket. For details, see Using kinit to log in to IdM manually.
-
Optional. Use the
ipa hostgroup-findcommand to confirm that the group includes the member you want to remove.
Procedure
To remove a host group member, use the
ipa hostgroup-remove-membercommand and provide the relevant information. You can specify the type of member to remove using these options:Use the
--hostsoption to remove one or more hosts from an IdM host group.For example, to remove the host named example_member from the group named group_name:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
--hostgroupsoption to remove one or more host groups from an IdM host group.For example, to remove the host group named nested_group from the group named group_name:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteRemoving a group does not delete the group members from IdM.
You can remove multiple hosts and multiple host groups from an IdM host group in one single command using the following syntax:
ipa hostgroup-remove-member group_name --hosts={host1,host2} --hostgroups={group1,group2}$ ipa hostgroup-remove-member group_name --hosts={host1,host2} --hostgroups={group1,group2}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
43.7. Adding IdM host group member managers using the CLI Copy linkLink copied to clipboard!
Designate hosts or host groups as member managers using the Identity Management (IdM) CLI to delegate host group membership management. Member managers can add or remove hosts from groups without having full administrative privileges.
Prerequisites
- Administrator privileges for managing IdM or User Administrator role.
- An active Kerberos ticket. For details, see Using kinit to log in to IdM manually.
- You must have the name of the host or host group you are adding as member managers and the name of the host group you want them to manage.
Procedure
-
Optional: Use the
ipa hostgroup-findcommand to find hosts and host groups. To add a member manager to a host group, use the
ipa hostgroup-add-member-manager.For example, to add the user named example_member as a member manager to the group named group_name:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
--groupsoption to add one or more host groups as a member manager to an IdM host group.For example, to add the host group named admin_group as a member manager to the group named group_name:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteAfter you add a member manager to a host group, the update may take some time to spread to all clients in your Identity Management environment.
Verification
Using the
ipa group-showcommand to verify the host user and host group were added as member managers.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
43.8. Removing IdM host group member managers using the CLI Copy linkLink copied to clipboard!
Remove hosts or host groups as member managers from an Identity Management (IdM) host group by using the CLI to revoke their ability to manage group membership. Member managers can add and remove group members but cannot change the attributes of the host group.
Prerequisites
- Administrator privileges for managing IdM or User Administrator role.
- An active Kerberos ticket. For details, see Using kinit to log in to IdM manually.
- You must have the name of the existing member manager host group you are removing and the name of the host group they are managing.
Procedure
-
Optional: Use the
ipa hostgroup-findcommand to find hosts and host groups. To remove a member manager from a host group, use the
ipa hostgroup-remove-member-managercommand.For example, to remove the user named example_member as a member manager from the group named group_name:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
--groupsoption to remove one or more host groups as a member manager from an IdM host group.For example, to remove the host group named nested_group as a member manager from the group named group_name:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteAfter you remove a member manager from a host group, the update may take some time to spread to all clients in your Identity Management environment.
Verification
Use the
ipa group-showcommand to verify that the host user and host group were removed as member managers.ipa hostgroup-show group_name Host-group: group_name Member hosts: server.idm.example.com Member host-groups: project_admins
$ ipa hostgroup-show group_name Host-group: group_name Member hosts: server.idm.example.com Member host-groups: project_adminsCopy to Clipboard Copied! Toggle word wrap Toggle overflow