Red Hat Training

A Red Hat training course is available for RHEL 8

第 4 章 从命令行搜索身份管理条目

以下章节描述了如何使用 IPA 命令,其可帮助您查找或显示对象。

4.1. 列出 IdM 条目的概述

您可以使用 ipa *-find 命令帮助您搜索特定类型的 IdM 条目。

要列出所有 find 命令,请使用以下 ipa help 命令:

$ ipa help commands | grep find

您可能需要检查特定的用户是否包含在 IdM 数据库中。然后您可以使用以下命令列出所有用户:

$ ipa user-find

要列出其指定属性包含关键字的用户组:

$ ipa group-find keyword

例如,ipa group-find admin 命令列出了其名称或描述包含字符串 admin 的所有组:

----------------
3 groups matched
----------------
   Group name: admins
   Description: Account administrators group
   GID: 427200002

   Group name: editors
   Description: Limited admins who can edit other users
   GID: 427200002

   Group name: trust admins
   Description: Trusts administrators group

在搜索用户组时,您还可以将搜索结果限制为包含特定用户的组:

$ ipa group-find --user=user_name

搜索不包含特定用户的组:

$ ipa group-find --no-user=user_name