48.4. Managing public SSH keys for users
Identity Management allows you to upload a public SSH key to a user entry. The user who has access to the corresponding private SSH key can use SSH to log into an IdM machine without using Kerberos credentials. Note that users can still authenticate by providing their Kerberos credentials if they are logging in from a machine where their private SSH key file is not available.
48.4.1. Uploading SSH keys for a user using the IdM Web UI リンクのコピーリンクがクリップボードにコピーされました!
Identity Management allows you to upload a public SSH key to a user entry. The user who has access to the corresponding private SSH key can use SSH to log into an IdM machine without using Kerberos credentials.
Prerequisites
- Administrator privileges for managing the IdM Web UI or User Administrator role.
Procedure
- Log into the IdM Web UI.
- Go to the Identity>Users tab.
- Click the name of the user to edit.
- In the Account Settings section, click the SSH public keys Add button.
- Paste the Base 64-encoded public key string into the SSH public key field.
- Click Set.
- Click Save at the top of the IdM Web UI window.
Verification
- Under the Accounts Settings section, verify the key is listed under SSH public keys.
48.4.2. Uploading SSH keys for a user using the IdM CLI リンクのコピーリンクがクリップボードにコピーされました!
Identity Management allows you to upload a public SSH key to a user entry. The user who has access to the corresponding private SSH key can use SSH to log into an IdM machine without using Kerberos credentials.
Prerequisites
- Administrator privileges for managing the IdM CLI or User Administrator role.
Procedure
Run the
ipa user-modcommand with the--sshpubkeyoption to upload the base64-encoded public key to the user entry.$ ipa user-mod user --sshpubkey="ssh-rsa AAAAB3Nza...SNc5dv== client.example.com"Note in this example you upload the key type, the key, and the hostname identifier to the user entry.
To upload multiple keys, use
--sshpubkeymultiple times. For example, to upload two SSH keys:--sshpubkey="AAAAB3Nza...SNc5dv==" --sshpubkey="RjlzYQo...ZEt0TAo="To use command redirection and point to a file that contains the key instead of pasting the key string manually, use the following command:
$ ipa user-mod user --sshpubkey="$(cat ~/.ssh/id_rsa.pub)" --sshpubkey="$(cat ~/.ssh/id_rsa2.pub)"
Verification
Run the
ipa user-showcommand to verify that the SSH public key is associated with the specified user:$ ipa user-show user User login: user First name: user Last name: user Home directory: /home/user Login shell: /bin/sh Principal name: user@IPA.TEST Principal alias: user@IPA.TEST Email address: user@ipa.test UID: 1118800019 GID: 1118800019 SSH public key fingerprint: SHA256:qGaqTZM60YPFTngFX0PtNPCKbIuudwf1D2LqmDeOcuA user@IPA.TEST (ssh-rsa) Account disabled: False Password: False Member of groups: ipausers Subordinate ids: 3167b7cc-8497-4ff2-ab4b-6fcb3cb1b047 Kerberos keys available: False
48.4.3. Deleting SSH keys for a user using the IdM Web UI リンクのコピーリンクがクリップボードにコピーされました!
Follow this procedure to delete an SSH key from a user profile in the IdM Web UI.
Prerequisites
- Administrator privileges for managing the IdM Web UI or User Administrator role.
Procedure
- Log into the IdM Web UI.
- Go to the Identity>Users tab.
- Click the name of the user to edit.
- Under the Account Settings section, under SSH public key, click Delete next to the key you want to remove.
- Click Save at the top of the page.
Verification
- Under the Account Settings section, verify the key is no longer listed under SSH public keys.
48.4.4. Deleting SSH keys for a user using the IdM CLI リンクのコピーリンクがクリップボードにコピーされました!
Follow this procedure to delete an SSH key from a user profile by using the IdM CLI.
Prerequisites
- Administrator privileges for managing the IdM CLI or User Administrator role.
Procedure
To delete all SSH keys assigned to a user account, add the
--sshpubkeyoption to theipa user-modcommand without specifying any key:$ ipa user-mod user --sshpubkey=-
To only delete a specific SSH key or keys, use the
--sshpubkeyoption to specify the keys you want to keep, omitting the key you are deleting.
Verification
Run the
ipa user-showcommand to verify that the SSH public key is no longer associated with the specified user:$ ipa user-show user User login: user First name: user Last name: user Home directory: /home/user Login shell: /bin/sh Principal name: user@IPA.TEST Principal alias: user@IPA.TEST Email address: user@ipa.test UID: 1118800019 GID: 1118800019 Account disabled: False Password: False Member of groups: ipausers Subordinate ids: 3167b7cc-8497-4ff2-ab4b-6fcb3cb1b047 Kerberos keys available: False