2

When I try to connect ec2 instance using this command from Ubuntu terminal:

ssh -i "private_key.pem"  ubuntu@ip_address

after taking some times it shows:

ssh: connect to host 18.116.70.233 port 22: Connection timed out

Note that:

1.firewall is inactive

2.rebooted 3-4 times

3.ssh is installed

but above command didn't work

RF1991
  • 2,037
  • 4
  • 8
  • 17

1 Answers1

0

Review the security group inbound and outbound traffic. If your computer is on a corporate network or if you are connecting through an internet service provider (ISP). Instead, specify the range of IP addresses used by client computers. If your security group does not have a rule that allows inbound traffic add a rule to your security group.

Here's a reference link to
security group rule
document

Below are steps to connect Amazon EC2 Instance from Ubuntu terminal

-Open terminal and Navigate to the location where you have saved your .pem key pair file.

-Secure your Key pair file. sudo chmod 400 abc.pem

-Connect to your instance using IP address. ssh -i abc.pem ubuntu@IP-address

Monali Ghotekar
  • 359
  • 1
  • 7
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 03 '22 at 19:53