I tried to map the following multi hop using a ssh configuration file:
ssh -tt -l jumphost 192.168.1.5 ssh -tt -l jumphost 192.168.2.111 ssh -tt -l inside_server 192.168.3.50
without using one of the following commands as a config:
ssh -oProxyCommand="ssh -q -oProxyCommand=\"ssh -q jumphost@192.168.1.5 nc -q0 192.168.2.111 22\" jumphost@192.168.2.111 nc -q0 192.168.3.50 22" inside_server@192.168.3.50
ssh -oProxyCommand="ssh -W %h:%p -oProxyCommand=\"ssh -W %%h:%%p jumphost@192.168.1.5\" jumphost@192.168.2.111" inside_server@192.168.3.50
ssh -J jumphost@192.168.1.5,jumphost@192.168.2.111 inside_server@192.168.3.50
Using the following ssh config
cat ~/.ssh/config
Host jump
RequestTTY force
Hostname 192.168.1.5
User jumphost
Host inside_gateway
ProxyCommand ssh jump
RequestTTY force
Hostname 192.168.2.111
User jumphost
Host inside_inside_server
ProxyCommand ssh inside_gateway
RequestTTY force
Hostname 192.168.3.50
User inside_server
I get a first login but after that it fails:
ssh inside_inside_server -vvv
OpenSSH_8.9 ... OpenSSL 3.0 ...
...
jumphost@192.168.1.5's password:
Bad packet length 21...
ssh_dispatch_run_fatal: Connection to UNKNOWN port 65535: message authentication code
incorrect
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
What's the problem here?