How to use ssh as a proxy server

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 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

Replace with your own hostname. That short command will create a socks5 proxy at 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 ..)

19 thoughts on “How to use ssh as a proxy server

  1. 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

  2. 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.

  3. 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…
    dont email me it doesnt work just reply on my myspace …..

  4. 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’

  5. 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 !

  6. This just makes a SOCKS proxy.
    how can i use it to make a http proxy …
    something like some applications such as ultrasurf or freegate or etc …

  7. I use ProxyCap (http:/ It will automatically create the ssh tunnel and will redirect my apps to this tunnel.

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.