wfgeo
wfgeo

Reputation: 3098

Trying to connect to AWS EC2 via SSH returns "port 22: no route to host"

I have an Ubuntu 16.04 EC2 instance on AWS and I have set its security group to look like so:

enter image description here

However when I try to connect to its private IP via ssh in the terminal, I get the error ssh: connect to host <my EC2 private IP> port 22: No route to host.

enter image description here

I tried running nmap localhost and confirmed that my port 22 is open:

enter image description here

Does anyone have an idea what might be going on?

Upvotes: 0

Views: 7468

Answers (1)

Ariel Steiner
Ariel Steiner

Reputation: 418

You are trying to connect to an instance private IP, but those are accessible only from within the internal network, i.e. between your EC2 instances.

To connect to your instance from outside you'll need a public IP. Normally specify you need one when you launch the instance, but you may also attach one later by creating a network interface (under Network Interfaces) and then attaching it to your EC2 instance.

Upvotes: 3

Related Questions