I have 2 EC2 Ubuntu instances: Instance-A and Instance-B. Both's ufw shows inactive and they are in the same subnet of a VPC. Both's security group allows all inbound and outbound traffic from anywhere. And they have identical ssh_config.
From command line of Instance-B, I can ssh to any of my SSH servers, either they are in the same VPC or non-AWS server.
However, from commaind line of Instance-A, I can only ssh to Instance-A and Instance-B using their private IP. I cannot ssh either (even Instance-A itself) using their public IP. Neither can I log in to any non-AWS server. The error is 'connection timeout'.
How can I make Instance-A' ssh client work?
[added facts]
- In Instance-A, I can ping google.com, A's public IP, B's public IP
- ssh client used to work well in Instance-A. I don't know what has changed.