Skip to content

Instantly share code, notes, and snippets.

@royling
Last active October 9, 2016 08:53
Show Gist options
  • Save royling/386f268debf23ae918ef800ebd1c922a to your computer and use it in GitHub Desktop.
Save royling/386f268debf23ae918ef800ebd1c922a to your computer and use it in GitHub Desktop.
Turn your Mac/Linux host to a SOCKS server in one cmd
#!/bin/bash
# try to kill existing process
ps aux | awk '/[s]sh -D 7070/ {print $2}' | xargs kill
# delay 1s
sleep 1
# start SOCKS proxy
ssh -D 7070 -fN user@host
  1. In terminal, run the below command: ssh -D7070 -fN <user>@<remote_host> or socks_proxy.sh

  2. Configure proxy in your browser:

  • Protocol: SOCKS5
  • Server: localhost
  • Port: 7070
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment