Reputation: 3098
I have an Ubuntu 16.04 EC2 instance on AWS and I have set its security group to look like so:
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
.
I tried running nmap localhost
and confirmed that my port 22 is open:
Does anyone have an idea what might be going on?
Upvotes: 0
Views: 7468
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