AWS EC2 instance is not connecting with terminal via SSH command

202 Views Asked by At

Whenever I try to connect my AWS EC2 instance via terminal using ssh command it shows a connection time-out problem.

One more thing, the public IP of that instance is not opening in a new tab, even after adding HTTP and HTTPS protocol in the inbound rule in the security group... Haven't found the solution til now. If you have any ideas/recommendations, share them in the comments below.

I changed the region to check if it was a problem in my region or not. But still showing the same thing. Checked my security group even.. Added HTTP and HTTPS in inbound rules but still public IP is not visible. I tried connecting via putty, but it still, didn't work.

Photo of inbound rules

1

There are 1 best solutions below

0
John Rotenstein On

When an SSH connection times-out, it is normally an indication that network traffic is not getting to the Amazon EC2 instance.

Things to check:

  • The instance is running Linux
  • The instance is launched in a public subnet, which is defined as having a Route Table entry to points to an Internet Gateway
  • The instance has a public IP address, which you are using when establishing the connection
  • The Network Access Control Lists (NACLs) are set to their default "Allow All" values
  • A Security Group associated with the instance that permits inbound access on port 22 (SSH) either from your IP address, or from the Internet (0.0.0.0/0)
  • Your corporate network permits an outbound SSH connection (try alternate networks, eg home vs work vs tethered to your phone)

See also: Troubleshooting connecting to your instance - Amazon Elastic Compute Cloud