February 13th, 2008

How to use ssh as a proxy server

Web, by Donncha.

Using ssh as a proxy or encrypted tunnel to browse the web can sometimes be necessary:

  1. When you’re at a conference but need to login securely to your blog.
  2. When local access restrictions make life really difficult.
  3. If you have a server in another country and want to see what Google Adsense adverts people see in that country.

I use ssh for the third reason. I want to see what adverts people in the USA see when they look at my blog so I can filter out the low paying and MFA ads (see notspam.org for more). Unfortunately I have a head like a sieve so unless it’s in the bash history I need to go look this up every few months:

ssh -D 8080 -Nf example.com

Replace example.com with your own hostname. That short command will create a socks5 proxy at 127.0.0.1:8080. Just configure your browser to talk to that and you’re surfing again!

Here’s a few external links you might find useful.

(I bet that when I most need to look up this post I’ll be behind a tight firewall that won’t let me at my blog ..)

You might also like

If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos and funny videos to explore too!

Back Top

Responses to “How to use ssh as a proxy server”

  1. Nice tip Donncha, thanks.

    adam

  2. Remeber to also check if the application can proxy dns requests over the SOCKS5 connection. Firefox can and many others can too. Proxing the dns requests will allow one to better anonymize traffic and allow you to check remote dns servers for updates or problems. Thanks for the positive review.

    Proxy Firefox through a SSH tunnel
    http://calomel.org/firefox_ssh_proxy.html

  3. Can you use this with the -p option if you are using a non-standard port? I tried it and all I get is a blank page when accessing websites.

  4. can you help write a proxy for my website so i can use it perferably PHP using cURL or something fast enough to load pages in 1 min or less…
    thanx
    dont email me it doesnt work just reply on my myspace …..

  5. ok look my there is this super blocker on the local computers called barracuda. and its kickin my ass. ive gotten around the last 3 or 4 blockers with some home made proxies and firewalls. but this 1 is straight kickin it. i cant even download my stuff to the computer cuase it says proxy or firewall… let me no if ya got anything. thanks john’

  6. Can I quote you in my report for school?

  7. Hey, thanks for than, I am having shared hosting, Can I do same thing on Shared ?

  8. I have been playing with this for various reasons and I noticed some of my equipment will only run over a http proxy.

    Any suggestions as to how I can plug a http proxy in front of the socks proxy…

    Isn’t ssh nice !

  9. please how can i configure my ssh turnelier to work with my AMS 4.3 software

    paul johnson at March 11, 2010 5:27 am
  1. SSH as Proxy | chys's random notes (,June 8, 2009)

    [...] [1] How to use ssh as a proxy server [2] Proxy Firefox through a SSH [...]

Leave a Reply

Back Top


Holy Shmoly! is Digg proof thanks to caching by WP Super Cache