Re:SSH Kung Fu
by hf on Monday April 28, 2014 @03:56AM
(#7658742)
What is more, you can specify an abstraction
for the tedious double-ssh where you first connect
to some internet-facing host in order to gain access
to an internal machine:
Now
becomes
(I just realized that this slightly confused
article seems to accomplish the same by using a convoluted
setup of port-forwardings and netcat.)
[ Parent
| on HN ]
The ssh -W option -- which replaces netcat -- is relatively new. E.g. Redhat 5.x did not have it, nor did Ubuntu 10.04 LTS. Until OpenSSH 5.4 netcat was the way to do this sort of proxying.
Re:SSH Kung Fu
by stock_toaster on Monday April 28, 2014 @06:14AM
(#7659053)
I ran into an issue[1] with the combination of -W and control persist -- using openssh versions < 6.0.
netcat worked fine.
[1]: https://news.ycombinator.com/item?id=4678117And if your router keeps dropping idle connections, add something like:
ServerAliveInterval 240
ServerAliveCountMax 5Can help on mobile (3G/4G) connections too.
> (I just realized that this slightly confused article seems to accomplish the same by using a convoluted setup of port-forwardings and netcat.)
Yeah, the article sets separately first
Host bar
...
and then Host behind.bar
...
But it can also be done by just one step: host behindbar
User <user-behindbar>
Hostname behindbar.domain
ProxyCommand ssh <user-bar>@bar.domain nc %h %p 2> /dev/null
Re:SSH Kung Fu
by michaelmior on Monday April 28, 2014 @09:10AM
(#7659622)
I use autossh[1] to keep a tunnel open in the background to $PUBLIC which lets me connect faster to $INTERNAL.