Managing SSH keys

Last updated: 2021-06-23 10:31:32

    Overview

    This document describes common operations related to using SSH key pair to log in to an instance. For example, you can create, bind, unbind, modify, or delete a SSH key pair.

    Note:

    To bind an SSH key to or unbind it from an instance, please shut down the instance first. See Shutdown Instances.

    Directions

    Creating a SSH key

    1. Log in to the CVM console.
    2. Click SSH Key on the left sidebar.
    3. Click New on the SSH Keypage.
    4. In the pop-up window, select a creation method as needed, enter the related information, and click OK.
      Note:

      After clicking OK, the private key will be automatically downloaded. Tencent Cloud will not retain your private key. Be sure to keep it safe.

      • If you select Create a new key pair, enter the key name.
      • If you select Use an existing public key, enter the key name and the original public key information.

    Binding a key to instance

    1. Log in to the CVM console.
    2. Click SSH Key on the left sidebar.
    3. On the SSH key management page, select the target SSH key, and click Bind with instances.
    4. In the pop-up window, select the target region and instances, and click Bind.

    Unbinding a key from instance

    1. Log in to the CVM console.
    2. Click SSH Key on the left sidebar.
    3. On the SSH key management page, select the target SSH key, and click Unbind from instances.
    4. In the pop-up window, select the region and instances to unbind from the key, and click Unbind.

    Modifying the SSH key name or description

    1. Log in to the CVM console.
    2. Click SSH Key on the left sidebar.
    3. On the SSH key management page, select the key to be modified and click next to the key name, as shown below.
    4. In the pop-up window, enter the new key name or description, and click OK.

    Deleting SSH keys

    Note:

    An SSH key cannot be deleted when it is bound with CVM instances or custom images, cannot be deleted.

    1. Log in to the CVM console.
    2. Click SSH Key on the left sidebar. You can delete a single or multiple SSH keys as needed.
      • Deleting a single key
        1. On the SSH key management page, select the SSH key to be deleted, and click Delete under the Operation column, as shown below.
        2. In the pop-up window, click OK.
      • Batch deleting keys
        1. On the SSH key management page, select SSH keys to be deleted, and click Delete above the list to batch delete them.
        2. In the pop-up window, click OK, as shown below.
          Only deletable ones of the selected key pairs will be deleted.

    Using a SSH key to log in to a Linux CVM

    1. Create a SSH key.
    2. Bind a SSH key to a CVM instance.
    3. Log in to a Linux instance via SSH key.