How to SSH directly to target via jumphost using SSH Config without additional ssh command

Solution 1:

You end up logged in to the jump host because your configuration explicitly says to ignore the hostname you specified and log in to the jump host.


HostName overrides the hostname specified on the command line.

If you are trying to automatically use a jump host without having to specify it on the ssh command line, the correct config file option is ProxyJump. For example:

Host everything, behind, jumphost, *

Now you can just run ssh and you will go through the jumphost.

Solution 2:

The problem is that the Host definition catches both AND as aliases, it then sets HostName to in both cases.

I would suggest making the aliases following the Host command NOT fully qualified domain names, then creating a Host entry for each