All Products
Search
Document Center

Elastic Compute Service:Create an SSH key pair

Last Updated:Mar 26, 2024

This topic describes how to create an SSH key pair in the Elastic Compute Service (ECS) console. After an SSH key pair is created, its private key is automatically downloaded. You must store the private key in a secure location. To log on to an ECS instance to which an SSH key pair is bound, you must provide the private key. You can have up to 500 SSH key pairs in a region.

Procedure

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Network & Security > Key Pairs.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. On the Key Pairs page, click Create SSH Key Pair.

  5. In the Create SSH Key Pair dialog box, configure the parameters that are described in the following table.

    Parameter

    Description

    SSH Key Pair Name

    Enter a name for the key pair. The name must be unique. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), hyphens (-), and colons (:). The name cannot start with a digit or a special character.

    Creation Type

    Select a method of creating the key pair. We recommend that you select Auto-create. You must store the private key in a secure location.

    • Auto-create: The system automatically creates a key pair. The private key is automatically downloaded after the key pair is created. The private key can be downloaded only once. You must store the private key in a secure location.

    • Import: You can import a Base64-encoded public key.

    Resource Group

    You can assign the key pair to a resource group for easy management. For more information, see Resource groups.

    Tag

    Select one or more tags to add to the key pair. You can add one or more tags to a key pair to facilitate resource search and aggregation. For more information, see Overview.

  6. Click OK.

    After the key pair is created, your browser downloads the private key file (Key pair name.pem) to your computer.

    Important

    Private key files are downloaded to your computer only if Auto-create is selected. Private key files are not saved in the ECS console and cannot be recovered if the files are lost. You must store the private key files in a secure location.

What to do next

Before you can use an SSH key pair to log on to an ECS instance, you must bind the SSH key pair to the ECS instance.

  1. For information about how to bind an SSH key pair to an instance, see Bind an SSH key pair.

  2. For information about how to log on to an ECS instance by using an SSH key pair, see Connect to a Linux instance by using an SSH key pair.