On client, run:
ssh -f -D SOCKS_PORT -N -p SSH_PORT USER@REMOTE_ADDRreplace:
SOCKS_PORT - with port to open local SOCKS server at (for example 1080).
SSH_PORT - with SSH port server is listening to (default is 22).
USER - with your login.
REMOTE_ADDR - with address of remote machine.
and enter your password.
You can now close the terminal.
To stop it, kill the SSH process or run without -f flag and press Ctrl+C.
To transfer traffic via another server, use:
ssh -D SOCKS_PORT -J USER_1@VIA_SERVER_IP:VIA_SERVER_PORT -N -p OUT_SERVER_PORT USER_2@OUT_SERVER_IPreplace:
SOCKS_PORT - with port to open local SOCKS server at (for example 1080).
USER_1 - with login to middle server.
VIA_SERVER_IP - with IP of middle server.
VIA_SERVER_PORT - with SSH port middle server is listening to.
OUT_SERVER_PORT - with SSH port output server is listening to.
USER_2 - with login to output server.
OUT_SERVER_IP - with IP of output server.
Then, on client, either:
A) Open a browser, find proxy settings and specify "SOCKS": address 127.0.0.1, port SOCKS_PORT (the one you specified).
B) Set system proxy to these values, but it will not work on Windows since Windows proxy settings does not support SOCKS. On Windows, better use third-party software for it, for example https://github.com/InterceptSuite/ProxyBridge.