Muffinresearch Labs by Stuart Colville

SSH SOCKS Proxy | 4 Comments

Posted in Linux/Unix on 19th January 2007, 1:30 pm by

I first saw this tip a while back on the Ubuntu Blog and it’s a useful way of using SSH to set-up private web surfing. Not to mention I’ve come across several public wifi installs that leave port 22 unfiltered so providing you set firefox to run the DNS from the remote server you should be able to browse with complete success over port 22.

This should work with any openssh implementation so it’s all good on both macs, linux and windows (Though from a brief foray into the world of window you’ll need Cygwin. Download it and select and install OpenSSH as a minimum and then run the same commands below from the shell)

To set-up a SOCKS proxy on port 1080 simply run:

ssh -D 1080 user@your-ip-address

To make firefox do DNS lookups through the remote server simply set network.proxy.socks_remote_dns = true in about:config.

To use the proxy simply set-up the socks 5 proxy config (Options/Preferences -> advanced -> Network -> Settings) by selecting “Manual Proxy configuration” (or use a plugin to firefox like Proxy Switch) and set the SOCKS Host to 127.0.0.1 and the port to 1080. Lastly select “SOCKS v5″

To test the proxy is working go to http://whatismyip.com/ and you should find the ip addres of your server is displayed.

Post Tools

GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Ubuntu: add-apt-repository: command not found|(3)

When you’re using a minimal Ubuntu install if you find the ‘add-apt-repository’ command is missing (it’s useful for adding PPAs and other repositories), then simply run:

sudo apt-get install python-software-properties

Photos on Flickr

© Copyright 2004-12 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.469s.