0

Hi I have setup an EC2 Ubuntu instance (A) for use with additional key-pair. Reason is that I need to connect with myuser to A instead of default user ubuntu.

  1. Got the new pem file from EC2>Network & Security>Key Pairs console.
  2. Created public key and added to ~/.ssh/config for my user myuser on A.
  3. Configured inbound rules for the A's security group allowing my local box (ipv4) to A.
  4. Verified that I am able to login from my local box to A successfully.

I repeated the same configuration (3-4) for connecting from another EC2 instance (B). I am seeing a connection timeout. Here's the verbose log.

OpenSSH_8.9p1 Ubuntu-3ubuntu0.4, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/ubuntu/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname xxx.xx.xx.xxx is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/ubuntu/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/ubuntu/.ssh/known_hosts2'
debug3: ssh_connect_direct: entering
debug1: Connecting to xxx.xx.xx.xxx [xxx.xx.xx.xxx] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: connect to address xxx.xx.xxx.xx port 22: Connection timed out
ssh: connect to host xxx.xx.xx.xx port 22: Connection timed out

Checking this decently detailed help page Particularly verified internet gateway, routing tables and ACL settings. All seem to be in place. Appreciate any help to debug this further.

1 Answer 1

0

This is an issue with outbound rules on machine A. The ssh port 22 was not open.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .