Unable to ssh from one ec2 to another

0

I am able to use Putty to connect to an EC2 instance from my local PC. But I am unable to ssh from the EC2 instance to another. When I ssh <ip> to the receiving EC2 instance nothing happens, just a blank blinking cursor. I am following an ansible tutorial from 2022 and this makes me think maybe I am missing something that has changed on AWS since then.

I have re-checked the following:

  • Security groups allow inbound and outbound as appropriate for each server
  • Inbound EC2 instance is set to allow inbound ssh from a security group, which I have confirmed is associated with the outbound EC2 instance
  • Public key from the outbound instance is correct and associated with the inbound EC2 (recreated the servers just to be sure)

I did see a Stackoverflow post where accounts can be isolated for various reasons. Not sure if that is applicable as I can ssh into the first EC2 instance from my PC.

asked 2 years ago385 views
4 Answers
1

Can you try the VPC Reachability Analyzer to see if it gives some insight?

profile pictureAWS
EXPERT
answered 2 years ago
  • Didn't even know this was a thing. Looks like I need to learn more about it.

1

Have you got any message when connecting via verbose mode

ssh -vvv ip

answered 2 years ago
1

Assuming that both instances are in the same VPC, or if they're in different VPCs that the VPCs are peered. Once you're logged in to instance #1 are you trying to SSH to instance #2's private IP address? It's easy to overlook, especially as you would have SSHed from your PC using instance #1's public IP.

profile picture
EXPERT
answered 2 years ago
0
Accepted Answer

With fresh eyes, I started over this morning and it works. I suspect that I did not choose the right key pair despite being sure I was. Not sure what else could be the issue. Better naming is needed on my end likely the cause. Thank you, everyone, for the responses.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions