SSH INTO A LINUX EC2 INSTANCE RUNNING IN AWS
In order for you to SSH into a Linux server in AWS, you need to understand how to allow your connection to successfully pass through the security group rules of the server.
From the last article on creating an EC2 instance as seen here, we had a security rule which allows all traffic to the EC2 instance.
To connect to the EC2 instance, all we need is public IP of the EC2 instance, the user name and the private key pair which we earlier configured.
You can get these details by clicking on the “instance ID” as seen below which starts with i-0cffxxxxxxx and of course you can also see the public IP.
Once you click on the “instance ID”, a page as the below appears, click on the “Connect” tab.
Once you click on the “Connect” tab, the page below opens, select the “SSH client” tab. On this tab, you can see the necessary information required for you to login to your EC2 instance.
Next, Open your terminal on your local PC, change your directory to the location where the private key pair is located and follow the instructions as seen on the screenshot above.
As you can see above, I was able to login to the EC2 instance easily without stress.
Follow this page for more tips on AWS services and you can also reach out to me by clicking on this link as I would love to hear your feedbacks.