Key Pairs
Key pairs are used to securely connect to your instances. When you launch an instance, you can specify the key pair to use. You can also associate a key pair with an existing instance.
- A key pair consists of a public key and a private key.
- The public key is stored on the instance and is used to encrypt messages.
- The private key is stored on your local machine and is used to decrypt messages.
- Key pairs are region-specific. If you launch an instance in a different region, you must create a new key pair for that region.
When you connect to an instance, you must specify the private key. If you lose the private key, you cannot connect to the instance.
Creating a key pair
- Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ (opens in a new tab).
- In the navigation pane, choose Key Pairs.
- Choose Create key pair.
- Enter a name for the key pair.
- Choose Create key pair.
- Save the private key file to a secure location on your local machine.