How to use Putty to connect to Alibaba ECS that using SSH key pair
Why use a key pair for Alibaba Cloud ECS?
Alibaba Cloud SSH key pair is a secure and convenient login authentication method. It consists of a public key and a private key, and only supports Linux instances. The SSH key pair generates a pair of keys through an encryption algorithm. By default, RSA 2048-bit encryption is used. To log in to a Linux instance using an SSH key pair, you must first create a key pair, specify the key pair when creating the instance, or bind the key pair after creating the instance, and then connect to the instance using the private key. Compared with username and password authentication methods, SSH key pairs have the following advantages:
Security: SSH keys are more secure and reliable for login authentication.
The security strength of key pairs is much higher than that of regular user passwords, which can prevent the threat of brute force cracking.
It is not possible to derive a private key from a public key.
ECS uses key pairs
When we configure the Alibaba Cloud ECS third-step system configuration, we choose a key pair, and then click New Key Pair.
Then enter the key pair name, click OK, and download the keypairfor3cx.pem file.
Next, we go to the third step of the system configuration interface, click the refresh button on the left of details, and then select the key pair we just created. Next, configure the instance creation according to your needs.
Putty connected to ECS
First we download puttygen to get our private key, open puttygen, click load, and then select the keypairsfor3cx.pem file we just downloaded.
Then fill in the key passphrase field, remember the password, we will need to connect later, and then save it as a private key, here we save it as 3cxprivatekey.ppk.
Next open the putty software and enter the public IP address of our ECS.
Go to Connection-SSH-Auth-Private key file for authentication. Click Browse button to upload the 3cxprivatekey.ppk file we just saved.
Then click Open, the interface shown in the figure below will pop up. The login account is based on the Linux system. I use Debian here and the login user is root. Next, you will be asked to enter the passphrase for key. Here we enter the password we used when filling out the key passphrase field. Now we can connect to the ECS server.