On Mon, Sep 22, 2014 at 08:25:10PM +0100, Adam Bower wrote:
On Mon, Sep 22, 2014 at 06:27:07PM +0100, Chris Green wrote:
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.
No! Jesus, this is not hard to understand, please try.
Create in your ssh config
Host chris Hostname zbmc.eu
and then on dnsmasq on the lan where this host is put into /etc/hosts the name zbmc.eu and the IP address of the machine on the local lan. Then the DNS lookup for this machine will resolve to the local IP address.
Then you can type ssh chris and it will do the right thing.
Yes, it will do the right thing when I'm on the LAN. It will *not* do the right thing (connect via the intermediate machine) when I am connecting from elsewhere.
Maybe I'm not explaining well but when I'm connecting from elsewhere my connection isn't direct to zbmc.eu. For security I only allow connections from two specific IP addresses, one of which is cheddar.halon.org.uk.
So the procedure (in longhand) to connect from outside is:-
ssh cheddar.halon.org.uk chris@cheddar.halon.org.uk's password: halon$ ssh zbmc.eu chris@zbmc.eu's password: Last login: Mon Sep 22 19:34:18 2014 from x201.zbmc.eu chris@chris$
Thus I have added the following lines in my ssh config file:-
Host halon HostName cheddar.halon.org.uk
Host chris ProxyCommand ssh cheddar nc -q0 zbmc.eu 22
These mean that I can enter 'ssh chris' from outside and it does all the work for me. However it also means that 'ssh chris' when I'm on the LAN also goes via cheddar.halon.org.uk because of the 'Host chris' line in the config file.