I recently upgraded to Ubuntu 22.04 LTS on two different computers and they share a confusing behaviour:
- From these 22.04 I can connect to others in the local network, with no issues
- From these 22.04 I can't connect to an external computer, long delay and timed out (see below)
- Also has an Ubuntu 20.04.3 LTS in my local network, from that 20.04 I can connect to that same external computer
- From that external computer I can connect to the 22.04 computers
I think this problem:
- is not related with firewalls, I don't have any installed, or router issues
- is not related with RSA issues, I share the same keys in all computers
- is not related with port, I use the default 22 port
Find here the full verbose output, hope it helps:
alice:~$ ssh -vvv externalHostOpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022debug1: Reading configuration data /home/user/.ssh/configdebug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no filesdebug1: /etc/ssh/ssh_config line 21: Applying options for *debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/user/.ssh/known_hosts'debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/user/.ssh/known_hosts2'debug2: resolving "externalHost" port 22debug3: resolve_host: lookup external-host:22debug3: ssh_connect_direct: enteringdebug1: Connecting to externalHost [XXXXX] port 22.debug3: set_sock_tos: set socket 3 IP_TOS 0x10debug1: connect to address XXX port 22: Connection timed outssh: connect to host externalHost port 22: Connection timed out*
Using strace I detected the last system calls, when execution is blocked before timed out
...fcntl(3, F_SETFD, FD_CLOEXEC) = 0getsockname(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128 => 16]) = 0getpid() = 10276setsockopt(3, SOL_IP, IP_TOS, [16], 4) = 0connect(3, {sa_family=AF_INET, sin_port=htons(22), sin_addr=inet_addr("externalHost-IPaddress")}, 16) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)