Unable To Connect Your EC2 Instance Using SSH?

Percy Alex Royan J
Tensult Blogs
Published in
3 min readJul 18, 2019
Ref:https://bit.ly/2JMkOrG

Let us see how to solve the problem while we are facing connectivity issues in a Instance through SSH.

Let us create a scenario that we have created an instance and we are are trying to launch through SSH ,but we are not able to connect and it shows the below error.

“Error: Connection timed out”.

This is a network Error so we need to focus on troubleshooting the configuration which are used to connect with the Internet.

The Steps that needed to be checked and the Solutions:

1.To ensure that you can connect to your EC2 instance using SSH, first verify that your Security Groups permit access to your EC2 instance over SSH from your IP address.

2.Select The EC2 Instance that you want connect from SSH.

3.Select the Security group for the EC2 Instance that we are trying to connect.

4.First thing that we have to make sure is that rules in Inbound Rules to update a rule that allows SSH from our current pubic IP Address If not rules are created,then create a new one by Add Rule option and by selecting your IP.

5.If the Inbound rules are not available add the SSH port in the inbound rule and now check,

6.Now try connecting the instance you will be able to login the instance as shown in the below diagram,

7. If still not working, the Second procedure that we need to check whether VPC route table that we have configured allows connecting with the Internet, If not then we have to edit our route table so that we can allow the traffic to connect to the internet.

Route table,Route,Internet gateway options

To edit the Route Tables follow the below Steps:

1. Select the Route Table option and choose the VPC from the lists shown.

2. Make sure the Default Route points out the Internet Gateway If it does not point out as shown in the below image proceed the next step,

3. Then in the Routes tab create a route that points 0.0.0.0/0 to our Internet gateway ID and save it.

4. Go back to Route Tables and select the Routes tab.

5. Edit and create a route that points 0.0.0.0/0 to your Internet gateway ID.

6. Save the route table.

If these settings are set properly the Error won’t be appearing as this error is mostly caused due to the connection is restricted as we don’t allow traffic to connect to the Internet by default.

--

--