Created
June 4, 2012 09:40
-
-
Save flashingpumpkin/2867483 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import os | |
import optparse | |
parser = optparse.OptionParser() | |
parser.add_option('-p','--port',help = "Port number locally", default = 8888) | |
if __name__ == "__main__": | |
opts, args = parser.parse_args() | |
print opts, args | |
if not len(args) == 1: | |
parser.print_usage() | |
sys.exit(0) | |
os.popen('ssh -NfD %s %s' % (opts.port,args[0] )) |
This is pretty trivial stuff. Why not use the SSH command directly? :)
Also, there's https://github.com/apenwarr/sshuttle, but I've never tried it out yet.
True true. Keeps me from remembering the SSH flags though. :)
.bashrc:
alias proxy="ssh -NfD $1 $2"
:)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run
proxy.py username@host -p 8888
to set up a SOCKS proxy listening locally on port8888
.