InCreateWhen an EC2 instance is started, we can create a temporary key pair file to remotely log on to the instance through SSH.
Alternatively, you can use the previously created key pair file.
However, sometimes we need to make all EC2 instances use the same keypair file (or even created by different AWS accounts). At this time, we need to upload an existing key pair file.
On the Management page, click Import keypair, enter the keypair name, and enter the public key content in Public Key contents.
What? You only have a private key file. You don't know where the Public Key is?
If the EC2 instance is in Linux, log on to your previous EC2 instance and find the. Ssh/authorized_keys file in the user's Directory, which contains your public key.
In this way, if you create an EC2 instance based on the public key, you can use the private key in your hand to log on to the instance.