36.5. Using an ID view to override the login name of an IdM user on a specific host


Create an ID view for a specific IdM client that overrides a POSIX attribute value associated with a specific IdM user. The procedure uses the example of an ID view that enables an IdM user named idm_user to log in to an IdM client named client1 using the user_1234 login name.

Prerequisites

  • You are logged in as IdM administrator.

Procedure

  1. On the IdM server, create a new ID view. For example, to create an ID view named example_for_client1:

    $ ipa idview-add example_for_client1
    ---------------------------
    Added ID View "example_for_client1"
    ---------------------------
      ID View Name: example_for_client1
  2. Add a user override to the example_for_client1 ID view. To override the user login:

    • Enter the ipa idoverrideuser-add command
    • Add the name of the ID view
    • Add the user name, also called the anchor
    • Add the --login option:

      $ ipa idoverrideuser-add example_for_client1 idm_user --login=user_1234
      -----------------------------
      Added User ID override "idm_user"
      -----------------------------
        Anchor to override: idm_user
        User login: user_1234

      For a list of the available options, run ipa idoverrideuser-add --help.

      注意

      The ipa idoverrideuser-add --certificate command replaces all existing certificates for the account in the specified ID view. To append an additional certificate, use the ipa idoverrideuser-add-cert command instead:

      $ ipa idoverrideuser-add-cert example_for_client1 user --certificate="MIIEATCC..."
  3. Optional: Using the ipa idoverrideuser-mod command, you can specify new attribute values for an existing user override.
  4. Apply example_for_client1 to the client1.idm.example.com host:

    $ ipa idview-apply example_for_client1 --hosts=client1.idm.example.com
    -----------------------------
    Applied ID View "example_for_client1"
    -----------------------------
    hosts: client1.idm.example.com
    ---------------------------------------------
    Number of hosts the ID View was applied to: 1
    ---------------------------------------------
    注意

    The ipa idview-apply command also accepts the --hostgroups option. The option applies the ID view to hosts that belong to the specified host group, but does not associate the ID view with the host group itself. Instead, the --hostgroups option expands the members of the specified host group and applies the --hosts option individually to every one of them.

    This means that if a host is added to the host group in the future, the ID view does not apply to the new host.

  5. To apply the new configuration to the IdM client system immediately:

    1. SSH to the client system as root:

      $ ssh root@client1
      Password:
    2. On the IdM client, clear the SSSD cache:

      # sss_cache -E
    3. On the IdM client, restart the SSSD daemon:
    # systemctl restart sssd

Verification

  • If you have the credentials of user_1234, you can use them to log in to the IdM client:

    1. SSH to the client system using user_1234 as the login name:

      # ssh user_1234@client1.idm.example.com
      Password:
      
      Last login: Sun Jun 21 22:34:25 2020 from 192.168.122.229
      $
    2. On the client system, display the working directory:

      $ pwd
      /home/idm_user/
  • Alternatively, if you have root credentials on the IdM client, you can use them to check the output of the id command for idm_user and user_1234:

    # id idm_user
    uid=779800003(user_1234) gid=779800003(idm_user) groups=779800003(idm_user)
    # user_1234
    uid=779800003(user_1234) gid=779800003(idm_user) groups=779800003(idm_user)
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部