0
votes

I m created an EC2 instance with default subnet and VPC. I m also added inbound and outbound rules(with port 22 is allowed from anywhere and outbound traffic can go anywhere) to it.
An Internet gateway also attached to the VPC and the route is defined as 0.0.0.0/0.

but I m getting the following error when tried to ssh it from my ubuntu machine

ssh: connect to host ec2-13-233-87-56.ap-south-1.compute.amazonaws.com port 22: Connection timed out

but I can able to ssh my other local machine from my ubuntu machine

1
Your ec2-13-233-87-56.ap-south-1.compute.amazonaws.com works. I don't know what you are testing. Maybe wrong address. What you posted works as expected.Marcin

1 Answers

0
votes

It looks like your local IP is not allowed to access the EC2 instance, you should allow port 22 for your IP to Security group of the EC2.

If the above step does not work, you can use EC2 Session Manager to connect to the instance and check if there's any wrong