News for hackers. Stuff that matters.
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:

    Host $ALIAS
        User $USER
        HostName $INTERNAL
        ProxyCommand ssh $USER2@$PUBLIC -W %h:%p
Now

    laptop> ssh [email protected]
    public> ssh dev@myworkstation
becomes

    laptop> ssh work
(I just realized that this slightly confused article seems to accomplish the same by using a convoluted setup of port-forwardings and netcat.)
Re:SSH Kung Fu by Erwin on Monday April 28, 2014 @05:50AM (#7659013)
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=4678117
Re:SSH Kung Fu by sampo on Monday April 28, 2014 @06:10AM (#7659047)
And if your router keeps dropping idle connections, add something like:

    ServerAliveInterval 240
    ServerAliveCountMax 5
Re:SSH Kung Fu by voltagex_ on Monday April 28, 2014 @07:28AM (#7659241)
Can help on mobile (3G/4G) connections too.
Re:SSH Kung Fu by sampo on Monday April 28, 2014 @06:16AM (#7659058)
> (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.

[1] http://www.harding.motd.ca/autossh/