0
votes

Running into the dreaded ssh connection timed out error. Current situation:

  1. inbound rule for port 22, open for all IPs and a separate rule just for myIP.
  2. used both public domain name and IP to connect neither works.
  3. No, i did not restart ec2 instance. So public domain and IP has not changed
  4. Turned off Mcaffee firewall on my PC, still nothing.
  5. Used SSHclient extension in chrome, same issue.
  6. Tried AWS SSH Java client, fails to connect with no specific error.
  7. access on private key file is set to 400, as recommended by AWS. I also tried with 777. Neither works
  8. instance status on AWS is good. status check is 2/2.

Output with -vvv flag:

debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolve_canonicalize: hostname xxx is address
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug2: ssh_connect_direct
debug1: Connecting to xxx port 22.
debug1: connect to address xxx port 22: Connection timed out
ssh: connect to host xxx port 22: Connection timed out
2
Did ssh -vvv give any useful debug output? - jarmod
Added -vvv output to post. - sotn
Are there any other services running on this machine you can connect to to verify they work? Can you ping or hit an HTTP endpoint? I don't suppose it's likely, but wondering if the SSH daemon is no longer running. - jarmod
No other services on the instance. - sotn
Are you running on a corporate network that has its own outbound firewall rules? Can you connect from a machine that's not running on that network (you don't have to be able to log in, just connect). - Parsifal

2 Answers

0
votes

Found the issue. Looks like at some point I deleted the default internet gateway. Created a new IG and associated it with the default VPC and added an entry for it in the route table.

-1
votes

check Network ACLs, Route Tables, SecurityGroup