Updated on 2022-02-22 GMT+08:00

Key Pair and Password

What Is a Key Pair?

A key pair, or SSH key pair, is an authentication method used when you remotely log in to Linux instances. A key pair is generated using an encryption algorithm. It contains a public key, and a private key reserved for you. The public key is used to encrypt data (for example, a password), and the private key is used to decrypt the data.

The cloud platform stores the public key, and you need to store the private key. Do not share your private key with anyone. Keep your private key secure.

Advantages

The key pair is more secure and convenient than the username/password method.

Table 1 Comparison between the key pair and username/password

Item

Key Pair

Username and Password

Security

  • More secure than the password and free from brute-force attacks
  • The private key cannot be derived from the public key.

Poor security

Convenience

Simultaneous login to a large number of Linux instances, simplifying management

Login to only one Linux instance at one time; batch maintenance cannot be performed.

Constraints

  • Only Linux instances support the key pair method.
  • Only RSA key pairs are supported. A key pair can contain 1024, 2048, or 4096 characters.
  • A Linux instance can have only one key pair. If a private key is bound to your BMS and you bind a new private key to the BMS, the new private key will replace the original one.

Generation Method

  • Create a key pair on the management console.

    When generating a key pair for the first time, download and properly save the private key.

  • Use PuTTYgen to create a key pair and import the key pair into the cloud platform.

Related Operations

Using an SSH Key Pair