Key pairs (SSH key pairs) are a set of security credentials for identity authentication when you remotely log in to ECSs.
A key pair consists of a public key and a private key. Key Pair Service (KPS) stores the public key and you store the private key. If you have bound a public key to a Linux ECS, you can use the corresponding private key, rather than a password, to log in to the ECS. You do not need to worry about password interception, cracking, or leakage.
For details, see Application Scenarios for Using Key Pairs.
This section describes how to use an SSH key pair to remotely log in to a Linux ECS from a Windows and a Linux server, respectively.
You have two methods to log in to a Linux ECS from a local Windows server.
Method 1: Use PuTTY to log in to the ECS.
The following operations use PuTTY as an example. Before using PuTTY to log in, make sure that the private key file has been converted to .ppk format. 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. Ensure that the format of All files (*.*) is selected. Figure 1 Importing the private key file Figure 2 Configuring the EIP Figure 3 Entering the username When you log in to an ECS using an SSH key: Figure 4 Importing the private key file



Method 2: Use Xshell to log in to the ECS.
ssh username@EIP
When you log in to an ECS using an SSH key:
Figure 5 SSH Security Warning

To log in to the Linux ECS from local Linux, perform the operations described in this section. The following operations use private key file kp-123.pem as an example to log in to the ECS. The name of your private key file may differ. chmod 400 /path/kp-123.pem In the preceding command, replace path with the actual path where the key file is saved. ssh -i /path/kp-123.pem Default username@EIP For example, if the default username is root and the EIP is 123.123.123.123, run the following command: ssh -i /path/kp-123.pem root@123.123.123.123 In the preceding command: