I recently discovered some very useful and productive features in OpenSSH 7.3 and later…
“Include” files! Awesome! Wow!
Much simpler ProxyJump settings…
However they break (stop it working) OpenSSH 7.2 and earlier clients…
So I have to have “special” configs for machines with old SSH clients (e.g. Ubuntu 16.04.5 seems to be stuck on OpenSSH_7.2p2), I can live with this a workaround. On everything else, my ~/.ssh/config is actually a symlink to a file I keep sync’d via Resilio Sync, and I’ve broken it up into more manageable files, a “master” config, with include entries for my home network, and a couple of customers…
However - just this morning I came across an ugly “anomaly” on Ubuntu 18.10 laptop I keep at work… Try to SSH to anything by an “alias / nickname” entry in my ~/.ssh/config file - and it comes back “temporary failure in name resolution”… e.g. my Resilio Sync box that travels to work and home again with me :
ssh ffrwchnedd (it’s a BananaPi running Armbian 5.7/Bionic Beaver - ffrwchnedd is Welsh for banana) and I get “temporary failure in name resolution”… the entry in my ssh config file :
Host ffrwchnedd ffrwchnedd.local bananapi ffrwchledd
# Resilio Sync portable thing
But I can “ssh firstname.lastname@example.org” successfully (using avahi name resolution).
And same issue when trying to connect to one of my customer’s jumphost/gateways :
I cannot “ssh jumphost” - I get “temporary failure in name resolution”. I’m not actually even trying to lookup the machine by host - I have the IP address in my SSH client configs! To compare I can do "ssh >redacted<@x.x.x.x (i.e. IP address of the jumphost).
I tweaked my /etc/nsswitch.conf a bit to no avail - rebooted twice - no avail…
Then I grabbed my ~/.ssh/config file and appended the three “include” files into it (using “cat” - what it was made for, i.e. conCATenating text), removed the “include” directives - and it’s all working again… bizarre!
Here’s my “old” ~/.ssh/config with includes :
I did “cat config home customer1 customer2 > ~/.ssh/new_config”, removed those “Include” lines - and it’s all working again - I don’t get it!
I connected to my home network from here - tested the “same” (i.e. w/ “Include” entries) on a couple of Ubuntu 18.04 machines and they’re all “working”…