Have you ever launched an EC2 instance and don’t know how to log in to your brand-new instance? It may sound difficult if you are a beginner, but it’s pretty much simple. Let’s take a look at how to connect to an EC2 instance using SSH, following the next simple steps whether you are using Linux or Windows.
SSH Key (.pem file) provided by Amazon: This SSH key is provided by Amazon when you launch the instance.
IP address: IP address assigned to your EC2 instance.
Username: The username depends on the Linux distro you just launched. Usually, these are the usernames for the most common distributions:
Amazon Linux: ec2-user
Only for Windows Users
Putty SSH Client installed on your PC. You can download the latest version.
How To Connect to an EC2 Instance Using SSH Using Linux
1. Open your terminal and change the directory with the command cd, where you downloaded your pem file. In this demonstration, the PEM file is stored in the downloads folder.