I have numerous stanzas like this in ~/.ssh/config :
Host dale
HostName gateway.mydomain.com
Port 2204
HostKeyAlias dale
which makes for convenient use of ssh to access a bunch of machines
behind the gateway. However, the problem is that when I am connected to
the LAN behind the gateway this doesn't work (of course it's not
necessary, but it doesn't work which is the problem). Possible
solutions are:
1) Maintain 2 different copies of ~/.ssh/config, one without the Host
stanzas and one with
2) Write a wrapper script for ssh which figures out where I am and does
the necessary
I don't much like 1) as it necessitates manually switching between
them. 2) would be OK, and looks like the most likely option. But I'm
wondering is there a more elegant 3) which might be some extra nifty
use of ssh config options.
Niall
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!