A key pair that consists of a public key and a private key is required for authentication when you log in to an ECS. Both the public and private keys are used for authentication. Therefore, you must use an existing key pair or create a new one for remote login authentication.
If a key pair is available locally, for example, generated using PuTTYgen, you can import the public key on the management console so that the system maintains the public key file. For details, see Importing a Key Pair.
If the public key of the existing key pair is stored by clicking Save public key of puttygen.exe, the public key cannot be imported to the management console.
If this key pair must be used for remote authentication, see Why Does a Key Pair Created Using puttygen.exe Fail to Be Imported on the Management Console?
An automatically allocated key name consists of KeyPair- and a 4-digit random number. Change it to an easy-to-remember one, for example, KeyPair-xxxx_ecs.
This is the only opportunity for you to save the private key file. Keep it secure. When creating an ECS, provide the name of your desired key pair. Each time you log in to the ECS using SSH, provide the private key.
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
PuTTYgen is a key generator, which is used to create a key pair that consists of a public key and a private key for PuTTY.
The key generator automatically generates a key pair that consists of a public key and a private key. The public key is shown in the red box in Figure 2.
Do not save the public key by clicking Save public key. Storing a public key by clicking Save public key of puttygen.exe will change the format of the public key content. Such a key cannot be imported to the management console.
The format in which to save your private key varies depending on application scenarios:
If you use this private file to obtain the password for logging in to a Windows ECS, when you choose Export OpenSSH key, do not configure Key passphrase. Otherwise, obtaining the password will fail.
If you store a public key by clicking Save public key of puttygen.exe, the format of the public key content will change. Such a key cannot be imported to the management console. To resolve this issue, obtain the public key content in correct format and import the content to the management console. For details, see Why Does a Key Pair Created Using puttygen.exe Fail to Be Imported on the Management Console?
When importing a key pair, ensure that the public key is imported. Otherwise, the importing will fail.
After the public key is imported, you can change its name.