Live data from Hacker News

Dynamic port forwarding using SSH, SOCKS5 and a VPS

medium.com

1–10 of 11 posts

Re: Dynamic port forwarding using SSH, SOCKS5 and a VPS

#4
ssh -D is half the story of the problem, particularly with socks5a DNS over it.

I'm becoming a bigger fan of sshuttle, everytime I need to use it.

Mostly by running SSH over the proxies using a CONNECT string (corkscrew) or using a ssh proxy-command to hop once over out of a DMZ.

Those combinations & composability of ssh is what makes it so much more useful inside a limited network.

Re: Dynamic port forwarding using SSH, SOCKS5 and a VPS

#6
I recommend using "autossh" to maintain ssh tunnels, since they could be flacky on some connections.

One day I should do a write up, but i have made an interesting setup for some robots I made

Server (with bots) > ssh tunnel maintained by autossh > vps > tinyproxy listening to localip and binded to open vpn connection > sending traffic on via an openVPN connection to random server (purevpn) in US

I even made scripts to periodically check status of the remote vpn status on the vps and reconnect if they went down

tl.dr:

Server > VPS with tinyproxy/openvpn > VPN Provider ips > Internet

I could probably do it all on same server but its handy being able to switch off the vps (and hence not pay for resources) when not in use and keeping things separate

Re: Dynamic port forwarding using SSH, SOCKS5 and a VPS

#7
post #6

I recommend using "autossh" to maintain ssh tunnels, since they could be flacky on some connections. One day I should do a write up, but i have made an interesting setup for some robots I made Server (with bots) > ssh tunnel maintained by autossh > vps > tinyproxy listening to localip and binded to open vpn connection > sending traffic on via an openVPN connection to random server (purevpn) in US I even made scripts…

thanks for suggesting autossh ;)

Re: Dynamic port forwarding using SSH, SOCKS5 and a VPS

#8
post #2

I'm sorry, but what's the point of this? Most of it is basic linux ssh setup, and the rest is running ssh -D 8080 Most of the setup isn't even required. SSH forwarding works out-of-the box for the vps provider I'm using.

sure it works, if you are happy with default configurations. the article gives informations on how things works and how to improve security

Re: Dynamic port forwarding using SSH, SOCKS5 and a VPS

#9
post #5

Instead of this wall of text I use Viscosity+pritunl vpn on gce. 5-clicks setup and works fine.

well the article is actually about a couple of commands but to explain them in details you need some more text. once you got to know how it works you can improve further and use other software like you do

Re: Dynamic port forwarding using SSH, SOCKS5 and a VPS

#10
post #4

ssh -D is half the story of the problem, particularly with socks5a DNS over it. I'm becoming a bigger fan of sshuttle, everytime I need to use it. Mostly by running SSH over the proxies using a CONNECT string (corkscrew) or using a ssh proxy-command to hop once over out of a DMZ. Those combinations & composability of ssh is what makes it so much more useful inside a limited network.

i have to look into sshuttle, i heard it's good
Post reply on HN