Reputation: 33
I have been stuck on this since last night. The command I am using is ssh -i myfile.pem ubuntu@publicIP
.
I have changed the chmod
to 400.
When I run the command in my terminal it doesn't do anything and then after about 30 seconds I see:
ssh: connect to host 18.234.225.93 port 22: Operation timed out
For my security groups, inbound I have selected:
Outbound is the same but one more row for all traffic
at 0.0.0.0/0
I am unsure as to what else I can do to make this work, and whether or not this is an issue on my end or AWS. I have followed some step by step instruction that I have found on here such as How do I set up SSH access for an Amazon EC2 instance? but with little success. If anyone can help, I would appreciate it.
Upvotes: 2
Views: 1411
Reputation: 238051
Based on your description in the comments.
Your VPC has only two private subnets. When you place an instance in a private subnet, as the name "private" suggests, there is no internet connectivity to it, nor it can connect by default to the internet.
To be able to directly ssh into your instance, it must be place in public subnet. So you would have to add such a subnet to your VPC, or convert existing private subnet into public.
For public subnet you need:
0.0.0.0/0
to the IGWExample of a VPC with both public and private subnets is shown in:
Upvotes: 2
Reputation: 269091
When an SSH connection times-out, it is normally an indication that network traffic is not getting to the Amazon EC2 instance.
Things to check:
0.0.0.0/0
)See also: Troubleshooting connecting to your instance - Amazon Elastic Compute Cloud
Upvotes: 0