ssh operation timed out when use MyIP on port 22

0

Hello! I m doing a SSH connection from my computer to an Amazon EC2 instance. When I configure with ssh protocol, port range 22 to 0.0.0.0/0 it works fine. However when I configure the security group with ssh protocol, port range 22 with select MyIP to permit the Inbound connection from my IP address. and run this command : ssh -i <your_pem_key> <username>@<ip-address>

I got this "ssh: connect to host X.XX.XX.XXX port 22: Operation timed out"

1 Answer
0

Is MyIP set to the wrong security group?
Please visit the following site to check your IP address.
https://checkip.amazonaws.com/

Other items to check are that the EC2 IP address has not changed.

profile picture
EXPERT
answered a year ago
  • I checked both and all set-up correctly. every EC2 connected with its security group. is that related to ACLs ? once I replaced MyIP to 0.0.0.0/0 it works.

  • If you have also changed the network ACL settings, please allow it with your IP in the inbound rules.
    For outbound rules, set the port range to "1024-65535" and set the IP address to your IP and enter the allow setting, or set the allow setting to 0.0.0.0/0 and you should be able to communicate. https://docs.aws.amazon.com/ja_jp/vpc/latest/userguide/vpc-network-acls.html

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