On top of figuring out why the config was "breaking", I discovered a new directive Match
. This lets me do what I intend
Host shortname1? Hostname %h.prod.xyz.comHost test-myname Hostname combo.test-myname.xyz.comHost *.xyz.com Hostname %hMatch Host *.xyz.com User myuser Port 12345 IdentityFile ~/.ssh/id_rsa
This config does exactly what I need. I needed to use Host
instead of Hostname
in the match because it didnt seem to accept Hostname
but Host
seems to be exactly what I need.
I was having arbitrary behaviour because I missunderstood that Hostname
could not be used as I was using before, as a filter or match like statement. It can only be used inside a Host
, or Match
and as such, was implicitly below the last Host
statement.