Info from https://sanctum.geek.nz/arabesque/ssh-socks-and-curl/
You need a server with ssh configured. Pay attention to /etc/ssh/sshd_config
:
#Port 22
This will be commented by default, so you can't access your ssh server from the outside. Uncomment it.
#Port 1234
Make sure that this also is uncommented:
AllowTcpForwarding yes
Start a ssh client:
ssh -ND localhost:8001 jd@localhost -p 1234
-N
to prevent a shell to start. We don't need one.-D
to start a dynamic port forwarding proxy server locally on the indicated port (here 8001).-p 1234
This is the port where the server is listening.
With curl:
curl --proxy socks5h://localhost:8001 https://text.npr.org/
the h
in socks5h
means that even DNS requests are forwaded.
To condigure Firefox, put localhost
in SOCKS hostname and 8001
in port. Make sure you tick Proxy DNS when using SOCKS5
.