Within AWS, all AMI Linux images are configured to authenticate any SSH session using a key pair authentication system instead of a password.
Before an EC2 instance is to be launched, AWS prompts us to configure an SSH key pair to be able to connect. We can either create our own SSH key pair or use an existing one:
- Let's create a new key pair and name it ubuntukey.
- Then, download the key pair and launch the instance. The key pair file we get is ubuntukey.pem. The name of the file will change based on the key name that was provided previously. Ensure that the key file is stored securely. In case the key is lost, AWS won't provide another key file and you will no longer be able to access your EC2 instance.
- Once the key file has been downloaded, AWS redirects you to the Launch Status page to let you know that your EC2 instance is being launched...