Skip to content

Instantly share code, notes, and snippets.

@johnagan

johnagan/ssh_tunnel

Created Jan 4, 2013
Embed
What would you like to do?
#!/bin/bash
disable_proxy()
{
networksetup -setsocksfirewallproxystate Wi-Fi off
networksetup -setsocksfirewallproxystate Ethernet off
echo "SOCKS proxy disabled."
}
trap disable_proxy INT
networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 9999
networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 9999
networksetup -setsocksfirewallproxystate Wi-Fi on
networksetup -setsocksfirewallproxystate Ethernet on
echo "SOCKS proxy enabled."
echo "Tunneling..."
ssh -ND 9999 your.proxy.server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment