Live data from Hacker News

A visual guide to SSH tunnels

robotmoon.com

11–20 of 82 posts

Re: A visual guide to SSH tunnels

#11
SSH tunnels are my favorite tool for NAT-busting. I always have to look up the cryptic syntax, but with one strategically placed Raspberry Pi, you can basically get from anywhere to anywhere.

And it works just as well on a locked down corporate network as it does on a home network. Why people put up with garbage VPN software is beyond me.

Re: A visual guide to SSH tunnels

#12
post #11

SSH tunnels are my favorite tool for NAT-busting. I always have to look up the cryptic syntax, but with one strategically placed Raspberry Pi, you can basically get from anywhere to anywhere. And it works just as well on a locked down corporate network as it does on a home network. Why people put up with garbage VPN software is beyond me.

SSH isn’t a replacement for VPNs. I’d argue that they complement each other.

For example, SSH port forwarding is TCP only, so if you need UDP, you‘ll need a VPN.

Re: A visual guide to SSH tunnels

#13
post #3

Really nice and clear. One addition: the final example uses ProxyCommand, I find ProxyJump much more useful: you can specify multiple hops clearly and even specify different private keys for each hop.

ProxyJump indeed seems more useful, but has less support (it's a "newer" SSH feature). Do you know if it needs to be supported by the openssh libs of intermediate hosts, or just the initiating client?

As far as I remember, it‘s implemented on the client only. (It can be replicated with ProxyCommand and a few invocations of cat/nc on the proxy host, if I remember correctly.)

Re: A visual guide to SSH tunnels

#14
post #12
post #11

SSH tunnels are my favorite tool for NAT-busting. I always have to look up the cryptic syntax, but with one strategically placed Raspberry Pi, you can basically get from anywhere to anywhere. And it works just as well on a locked down corporate network as it does on a home network. Why people put up with garbage VPN software is beyond me.

SSH isn’t a replacement for VPNs. I’d argue that they complement each other. For example, SSH port forwarding is TCP only, so if you need UDP, you‘ll need a VPN.

[note I am wrong here - it doesn't support UDP - see below]

The ssh SOCKS proxy supports UDP. I use Firefox with a SOCKS proxy via ssh (e.g. ssh -D 2222 hostname) to get around geoblocking and accessing papers via an institutional account. The tsocks program can also let you use a SOCKS proxy for an arbitrary command in linux. I find it much more convenient than a VPN, as it can be easily applied to single programs.

Re: A visual guide to SSH tunnels

#17

Really nice and clear. One addition: the final example uses ProxyCommand, I find ProxyJump much more useful: you can specify multiple hops clearly and even specify different private keys for each hop.

ProxyCommand is useful for proxying with a non-SSH protocol. For example when combined with proxytunnel or similar you can run your SSH connections over an HTTPS proxy, which appears as regular web traffic to the network operator.

Re: A visual guide to SSH tunnels

#19
post #14
post #12

Earlier quoted context omitted.

SSH isn’t a replacement for VPNs. I’d argue that they complement each other. For example, SSH port forwarding is TCP only, so if you need UDP, you‘ll need a VPN.

[note I am wrong here - it doesn't support UDP - see below] The ssh SOCKS proxy supports UDP. I use Firefox with a SOCKS proxy via ssh (e.g. ssh -D 2222 hostname) to get around geoblocking and accessing papers via an institutional account. The tsocks program can also let you use a SOCKS proxy for an arbitrary command in linux. I find it much more convenient than a VPN, as it can be easily applied to single programs.

Are you about this? Last time I've checked SSH SOCKS5 only supports TCP traffic, UDP isn't supported and needs extra steps through tools like socat to wrap UDP in TCP.

http://lists.mindrot.org/pipermail/openssh-unix-dev/2017-Jan...

Re: A visual guide to SSH tunnels

#20
post #11

SSH tunnels are my favorite tool for NAT-busting. I always have to look up the cryptic syntax, but with one strategically placed Raspberry Pi, you can basically get from anywhere to anywhere. And it works just as well on a locked down corporate network as it does on a home network. Why people put up with garbage VPN software is beyond me.

One can further tunnel SSH inside of TLS with Stunnel [0] to get through firewalls that block SSH but permit arbitrary TLS connections. Loading a website through this requires three layers of TCP but assuming the connection is good this should be okay.

A couple reasons for a regular VPN: they can be made automatic and persistent so the tunnel is always ready for use, they can tunnel other protocols besides TCP, they can tunnel entire networks, and using UDP as the tunnel protocol helps avoid the TCP-in-TCP congestion issues.

[0] https://en.wikipedia.org/wiki/Stunnel

Post reply on HN