Skip to content

Instantly share code, notes, and snippets.

@jaderfeijo
Last active March 1, 2016 16:40
Show Gist options
  • Save jaderfeijo/9a5b51df98da2ecbe8cb to your computer and use it in GitHub Desktop.
Save jaderfeijo/9a5b51df98da2ecbe8cb to your computer and use it in GitHub Desktop.
sshpd
usage() {
echo "Usage: sshpd [start|stop] [username@server_address]"
}
if [ "$1" == "start" ]; then
if [ "$2" != "" ]; then
ssh -D 8080 -f -C -q -N $2
echo "[sshpd] service started!"
echo "[sshpd] listening for incoming connections on port 8080..."
else
usage
fi
elif [ "$1" == "stop" ]; then
pkill -x ssh
echo "[sshpd] service stopped!"
else
usage
fi
@jaderfeijo
Copy link
Author

Usage: sshpd [start|stop] [username@server_address]

@jaderfeijo
Copy link
Author

To install, open a new Terminal window and type the following:

mkdir ~/.scripts && curl https://gist.githubusercontent.com/jaderfeijo/9a5b51df98da2ecbe8cb/raw/6c48b2056c8eeb370e1b2cb2a25744ec72f19bff/sshpd > ~/.scripts/sshpd && chmod a+x ~/.scripts/sshpd && echo 'PATH="$PATH:~/.scripts"' >> ~/.bash_profile && source ~/.bash_profile

@jaderfeijo
Copy link
Author

To uninstall, type the following on a Terminal window:

rm -r ~/.scripts

Then edit your ~/.bash_profile file and remove the line that says:

PATH="$PATH:~/.scripts"

Then type:

source ~/.bash_profile

@jaderfeijo
Copy link
Author

Once the server is running, just configure your web browser to access the server as you would any other SOCKS proxy, point it to localhost and have fun!

More information on how to setup the proxy server can be found here:
http://paulstamatiou.com/how-to-surf-securely-with-ssh-tunnel/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment