Managing SSH keys by using the CLI

You can use the command-line interface (CLI) to work with Secure Shell (SSH) keys.

Procedure

To work with SSH keys, complete these steps.

  1. Issue the lsuser CLI command to list the SSH keys that are available on the system.
  2. Create an SSH key on a host system and then copy the file to the system.
    For example, use ssh-keygen on a Linux® server or use the PuTTY tool on a Windows server.
  3. Issue the mkuser or chuser CLI command to install a new SSH key on the system.
    When you run the command, the SSH key is copied into system state and activated for the user, and the input file is deleted. Each key must be unique and can only be associated with one user on the system.
  4. Use the chuser command or the chcurrentuser command to remove an SSH key from the system.

Example

To create an SSH key on a Linux host, run the ssh command.
ssh-keygen -t rsa
Use secure copy to copy the file to the system.
scp /tmp/OU812.pub user_name@system_ip:/tmp
Run one of the following commands.
  • To create a user ID and assign the SSH key to the user, run the mkuser command.
    mkuser -name jane -usergrp Service -keyfile /tmp/OU812.pub
  • To assign the SSH key to an existing user ID, run the chuser command.
    chuser -keyfile /tmp/OU812.pub user_id_or_name