To create a SOCKS proxy which tunnels all of your traffic through ssh, you have to go to System preferences > Network > Wi-fi > Proxies > SOCKS-Proxy
Here enter localhost as host and 8080 as port. Don't enable the checkbox, at SOCKS-Proxy, the script takes care of that.
Create the file tunnel.sh and make it executable (chmod +x tunnel.sh
). To establish the connection,
run ./tunnel.sh
- now everything uses the ssh-tunnel. To kill it, press ctrl + C.
This is useful to hop on a trusted environment in public wifis.