I logged in Console with root account and copied :
ssh -i "Ec2leaning.pem" ubuntu@ec2-3-82-49-100.compute-1.amazonaws.com
from pem file path opened git and ran above command.
I am not able to connect receiving an error like
ssh: connect to host ec2-3-82-49-100.compute-1.amazonaws.com port 22: Connection timed out
check the machine is running if it is running please take the correct ssh id
I hope this is useful to you if not please ignore
Note: if you run your machine with a default vpc noproblem but if you run your machine with custom vpc please check once your vpc is configured correctly or not
if you find the solution to this please close the issue
I have launched an EC2 machine through (CLI User) CLI with default VPC and Subnet:
aws ec2 run-instances --count 1 --image-id ami-04b9e92b5572fa0d1 --instance-type t2.micro --key-name Ec2leaning --security-group-ids sg-bf723de5 --subnet-id subnet-37065e6b
I logged in Console with root account and copied : ssh -i "Ec2leaning.pem" ubuntu@ec2-3-82-49-100.compute-1.amazonaws.com from pem file path opened git and ran above command.
I am not able to connect receiving an error like ssh: connect to host ec2-3-82-49-100.compute-1.amazonaws.com port 22: Connection timed out