2 ms·
A very powerful feature of ssh is port forwarding and running SOCKS5 proxy out of the box (which possible in both directions). Check -D, -R (both support SOCKS
by shmerl 4y ago
A very powerful feature of ssh is port forwarding and running SOCKS5 proxy out of the box (which possible in both directions).
Check -D, -R (both support SOCKS5 now) and -L options in man ssh.
- lucb1e 4y ago-R is a reverse tunnel similar to -L, something very different from -D which is indeed a SOCKS proxy.
- shmerl 4y ago-R now supports SOCKS5 too. Except you initiate it from the other side (compared to -D), which is pretty cool and gives the same practical effect.
- lucb1e 4y agoHow does that work? Does it try to autodetect whether you're speaking SOCKS to it? What if you want to reverse tunnel a socks proxy from another process like Tor?
- shmerl 4y agoIf I understand correctly, something like this: Let's say you have hosts A and B. Doing this from A: ssh -R 1080 B will start a SOCKS5 proxy on A, to which you can connect on B through port 1080 that's being forwarded there. So your web client running on B will use traffic proxied through A while connecting to 1080 on localhost. > Does it try to autodetect whether you're speaking SOCKS to it I think it just uses SOCKS5 out of the box if you don't specify the host for -R. According to the man page for -R: if no explicit destination was specified, ssh will act as a SOCKS 4/5 proxy and forward connections to the destinations requested by the remote SOCKS client.
- singlow 4y agoIf you don't specify a destination for -R it will work in SOCKS mode. > ssh -R 8080:localhost:8080 #Port forward vs > ssh -R 8080 #SOCKS
- JanisErdmanis 4y agoAfter covid hit and I had already gone back to my home country, ssh proxy was the only way I could bypass my university's buggy 2FA to put my working hours in time management software every month. To get there, I had to bypass the university's bastion server and log into a cluster which was able to gain access to the internet. Wild times :D