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
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_client1Add a user override to the example_for_client1 ID view. To override the user login:
-
Enter the
ipa idoverrideuser-addcommand - Add the name of the ID view
- Add the user name, also called the anchor
Add the
--loginoption:$ 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_1234For a list of the available options, run
ipa idoverrideuser-add --help.注意The
ipa idoverrideuser-add --certificatecommand replaces all existing certificates for the account in the specified ID view. To append an additional certificate, use theipa idoverrideuser-add-certcommand instead:$ ipa idoverrideuser-add-cert example_for_client1 user --certificate="MIIEATCC..."
-
Enter the
-
Optional: Using the
ipa idoverrideuser-modcommand, you can specify new attribute values for an existing user override. Apply
example_for_client1to theclient1.idm.example.comhost:$ 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-applycommand also accepts the--hostgroupsoption. 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--hostgroupsoption expands the members of the specified host group and applies the--hostsoption 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.
To apply the new configuration to the IdM client system immediately:
SSH to the client system as root:
$ ssh root@client1 Password:On the IdM client, clear the SSSD cache:
# sss_cache -E- 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:
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 $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
idcommand 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)