Connecting to EC2 Instance from a Local Machine.
Let's check out how to connect to the EC2 instance from a local machine.
From Windows machine:
Windows system doesn't have an inbuilt SSH client as in Linux/Mac OS. So, you need to download a third-party client such as PuTTY to connect.
Also, the key pair needs to be converted to ppk format using Puttygen which you get along with PuTTY and connect using the public IP.
From Linux/Mac:
In case of Linux/Mac, this is simple. Connecting the instance involves just a few Linux commands. First, open the terminal and go to the folder where the keys are presents.
You need to change permissions on keys using chmod 400 samplekeyname.pem.
Then, enter ssh ec2-user@public IP of instance -i samplekeyname.pem.
ec2-user is for an Amazon Linux. It differs from one another instances.
Connection to Windows instance is done through various clients available in the store of Linux/Mac, and from windows system through the regular remote desktop connection client.