While working with the AWS EC2 instance you do not get a Username and password to SSH into your EC2 instance. You have to either generate the SSH keys and associate the public key with the EC2 instance. After that, you need to use your private key to SSH into the virtual machine running in the AWS cloud.
On similar lines, if you are using Terraform to provision your AWS infrastructure you need to associate the public key with your terraform script and after starting the EC2 instance you need to use your private key to SSH into the EC2 instance.
In this lab session, we are going to perform the following steps -
- Generate key-pair(public key, private key) using ssh-keygen
- Use public key to start EC2 instance
- Use the private key to SSH into EC2 instance