- Newest
- Most votes
- Most comments
Are you getting any error message at all or is it just sitting there until timing out?
To be able to connect to the target's private IP, the source must also be in the same VPC. The source must have a security group rule allowing outbound over port 22 to the target's private IP, and the target must have a rule allowing inbound over port 22 from the source's private IP.
If the source & target are in different VPCs then the VPCs need to be peered for the above to work.
If the source is trying to connect over the internet then the target's public IP needs to be used, not the private IP.
Does that make things any clearer?
What exact error do you see? Is the instance in public/private subnet?
It keeps trying to connect until the time expires, it does not show an error. Regarding the instance, it is related to a vpc, also linking the subnet to the vpc.
check if you can telnet the 22 port, if not then security group as well if any os firewall like iptables are blocking
Relevant content
- asked a year ago
- asked 10 months ago
- Accepted Answerasked 8 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 years ago
I configured outgoing ssh rules for the EC2 remote ip and incoming ssh for the local ip. But it tries to connect and it doesn't show any error message.
It's less clear now than it was before.
The EC2 instance that you are having trouble, from what are you trying to connect to it?
Are you trying to connect from another EC2 instance in the same VPC?