- Documentation
Elastic Compute Service
Elastic Compute Service
User Guide
Security
Passwords and key pairs
Key pairs
Viewing public key information
Key pairs
Viewing public key information
Viewing public key information
If you want to specify that a single instance uses multiple public key files but do not have a local backup of the public key files, you can view and obtain public key information by using the three methods described in this topic.
Applicable scenarios
- Within a Linux instance, you can use the obtained public key information to add multiple key pairs to an instance, allowing login to the same ECS instance by using multiple key pairs. For information about how to add multiple key pairs to an instance, see Adding or replacing key pairs.
- You can follow the instructions in this topic to create a key pair by importing an existing public key based on the obtained public key information.
Procedure
View within an instance
Local Windows operating system
Local Linux or macOS operating system
- Execute the following command to open the key pair configuration file. You can then view the public key information.
- In the browser on your local Windows host, access PuTTYgen, and then download and install PuTTYgen.
- Double-click the puttygen.exe file.
- Select "Type of key to generate > RSA". Then click "Load".
-
- Select a .ppk or .pem file to display public key information.
Execute the following SSH command to view public key information.
Public key information similar to the following output is displayed.
tip
If no public key information is returned, you can execute the chmod 400 <key pair file path>/<key pair name>.pem command to change the permissions. This ensures that only you can view the file.
Subsequent operations
After you obtain a public key, you may need to perform the following operations:
Last updated: 2026.06.18 17:49:49