Using ssh as a proxy or encrypted tunnel to browse the web can sometimes be necessary:
- When you’re at a conference but need to login securely to your blog.
- When local access restrictions make life really difficult.
- 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.
- Matt had trouble with his socks5 dns while travelling.
- Proxy Firefox through a SSH tunnel
- I need to install Foxy Proxy to make this easier to manage.
– if only I had searched for the right terms I would have found this excellent page sooner.
(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”
Nice tip Donncha, thanks.
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
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.
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 …..
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’
Can I quote you in my report for school?
Cool technique for using SSH as a proxy. Combined with Foxy Proxy, its great for secure browsing on the go. http://bit.ly/gMun
Hey, thanks for than, I am having shared hosting, Can I do same thing on Shared ?
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 !
please how can i configure my ssh turnelier to work with my AMS 4.3 software
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 …
@miosman Ù„Ø§ Ø´ØºÙ„ØªÙ‡ Ø¹Ù„Ù‰ Ø§Ù„Ù€ ssh http://ocaoimh.ie/how-to-use-ssh-as-a-proxy-server/
You can use a software called privoxy to convert SOCKS proxy to a http proxy.
Thanks a lot. It works perfectly on my Mac.
I use ProxyCap (http:/www.proxycap.com/). It will automatically create the ssh tunnel and will redirect my apps to this tunnel.