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 [email protected] nc -q0 192.168.2.111 22\" [email protected] nc -q0 192.168.3.50 22" [email protected]
ssh -oProxyCommand="ssh -W %h:%p -oProxyCommand=\"ssh -W %%h:%%p [email protected]\" [email protected]" [email protected]
ssh -J [email protected],[email protected] [email protected]
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 ...
...
[email protected]'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?