How to create Socks Proxy with SSH
Use this command to create a socks proxy using SSH tunnel:
ssh -D 8080 user@server_ip
You can adjust the port nummber. Use SSH server’s user and ip in the command.
Optional: Add Socks Proxy to SSH config file
You can also put in SSH config file, so when you connect to the SSH host, it will automatically run a socks proxy.
Edit SSH config file:
vim ~/.ssh/config
Create an entry for SSH server:
Host rpi
HostName 192.168.0.91
User aman
DynamicForward 8080
Set Host value whatever you want. HostName is the IP address of the server. User is SSH username. Adjust the port no. if required, save the file.
Configure your browser to use your Socks proxy
If you are using linux, you can use option --proxy-server="socks5://127.0.0.1:8080" with any Chromium based browser like Google Chrome, Brave Browser , Thorium.
google-chrome --proxy-server="socks5://127.0.0.1:8080"
In Firefox browser, you can natively set the proxy, open the settigns and search for proxy.
You can also adjust your browser’s application launcher file and add option --proxy-server="socks5://127.0.0.1:8080", so next time you open your browser, it will automatically use the socks proxy.