When I\'m on a certain network (subnet is 10.10.11.x) I need to jump through an intermediate host to reach my destination because of destination port I can\'t change and limited
You can use Match's exec
option to execute shell commands, so you can write something like this:
Match host web exec "hostname -I | grep -qF 10.10.11."
ForwardAgent yes
ProxyCommand ssh -p 110 -q relay.example.com nc %h %p
Host web
HostName web.example.com
Port 1111
The Match
option boolean logic can short-circuit, so put host
first to skip the exec
term for other hosts. Try ssh web -vvv
to see the Match
logic in action.