0
votes
  1. I am trying to connect to my AWS EC2 instance from gitbash in windows10 machine.
  2. I am using the below command in ssh.

    ssh: connect to host ec2-XX-XX-XX-XX.compute-1.amazonaws.com port 22: Connection timed out

  3. I have tried connecting from a terminal in linux machine also, But same

    "connection times out"

errors is what i get. 2. Tried Putty but i get the same error as abiove

UserName@PC-NAME1 MINGW64 /c $ ssh -i "portfolioec2key.pem" [email protected] ssh: connect to host ec2-3-94-109-39.compute-1.amazonaws.com port 22: Connection timed out

1
Yes. Inbound rules are below. Type Protocol Port Range Source SSH TCP 22 XX.XX.XX.XX/32(custom)Walluri
Hello Guys if you face the error even after al;l your security groups are good plus you are connecting from corporate ip... then it means that your administrator is blocking or doing somethign which is preventing you from connecting to your aws ec2 instance.Walluri
So what i did is i installed a terminus app and added a all tcp rule connected using telnet protocol from port 33. pls note to copy the username , dns, and keep the key downloaded in mobile. :-)Walluri

1 Answers

0
votes

1)check pem file permission. change pem file permission to 600

chmod 600 portfolioec2key.pem

2) try to telnet you EC2 instance ip address

telnet xx.xx.xx.xx 22.

if succeeded then there is issue with your pem file if not then check below things.

3) Check security group inbound rule.

4) Check NACL .

5) Check your instance is in public subnet or not.

6) If your having VPN connectivity check your instance is in right subnet and having proper connection.