Help with Socks5 over SSH!

recently got a Pi, and one of the first things I wanted to try with it was to open an SSH socks5 proxy, since my school has basically everything banned. I hoped that this would allow me to bypass the restrictions. However, I’m not exactly sure how to do it, and the few videos and websites I found weren’t very helpful. I already set my pi to forward port 22, and can successfully SSH to it on my laptop using a mobile hotspot. However, the proxy part doesn’t seem to work. this is the Gitbash line I’m using to connect to the Pi:

$ ssh -D 9090 Name@PublicIP -p 22

and my windows proxy settings are set to:

Localhost Port: 22

I’m mainly doing this for fun, but I just wanted to know if this method would be a valid way of bypassing my school’s firewall. I’m not sure how they block sites, but I suspect it’s DPI, since most VPNs are also banned on the network. The network seems to be using Fortinet as its firewall.

Any help would be appreciated :slight_smile: Thanks

Localhost Port: 22

You need to change this to 9090, then it will work

You need to proxy to localhost:9090

-D binds to a specific address that is not what you want.

Assuming you have proxy running on whatever you are going to ssh to.

ssh -L 9099:localhost:9099 [email protected]

This will open port 9099 on your local box, it will take any traffic that is sent to that port and forward it to the port on the box you ssh’ed to.

Is that what you want?

Thanks for the reply, so the port that il forwarding doesn’t have to be mentioned in the command?

Also, do you need to set up a proxy server on the pi? I was under the assumption that you didn’t need one, and that you only needed an ssh connection :sweat_smile:

So what you’re saying is that I should use that command, as well as open a socks proxy on my pi?