On Mon, Sep 22, 2014 at 04:37:57PM +0100, Adam Bower wrote:
Ditch the proxycommand and just set the ssh config to connect to zbmc.eu directly, and set the hostname for zbmc.eu internally with dnsmasq on your internal lan via /etc/hosts as already suggested. I don't see why you feel this won't work.
It will of course, but then I'm left with a long complex procedure to connect to my home machine when I'm out and about.
This is were we came in! :-)
Obviously it's easy enough to set things up so when I'm at home (on the LAN) I can just type 'ssh chris' to connect to my desktop.
However when I'm away from home I quickly get fed up with typing 'ssh cheddar.halon.org.uk' followed by 'ssh zbmc.eu' so I set up the ProxyCommand to make it so I can type just 'ssh chris'.
All I was looking for was any easy way to switch from one mode to the other, preferably one that would work automatically.
I can see all sorts of rather messy ways of doing it (others have suggested some), but I was hoping for a neat/elegant way of doing it.
The best I can come up with at the moment is a script that detects whether it's on the LAN (using 'ping' does this fairly easily) and then edits the ~/.ssh/config file. However scripts that perform actions by editing configuration files on the fly make me a bit uncomfortable.
A neater way might be to use the 'match' keyword in the ssh config file, I was hoping that maybe someone had already done something like this.