How To Use Your Dedicated Virtual Server As An Internet Proxy Using SSH Tunneling

James Bruce 20-04-2011

internet proxy serverI explained some of the benefits of having your own virtual private server The Various Forms Of Website Hosting Explained [Technology Explained] Read More hosting account a while ago – not only are they faster and able to host many more of your sites, you can also configure W3 Total Cache for optimum performance How To Configure The Various W3 Total Cache Plugin Settings For Your Wordpress Blog A while ago I talked about the benefits of installing the W3TC plugin on your Wordpress blog in order to speed it up with various caching, but some readers were understandably a little wary about... Read More by installing special Apache caching extensions. Today I’m going to show you how you can also use it as a private Internet proxy server for secure Internet browsing.


This is particularly beneficial in countries such as China, where most commercial proxy solutions have stopped working altogether. Read on for a full explanation of how you can go about using your own VPS hosting account as a private proxy.

First up, a few points to clear up:

Can I Use This Method With My Shared Hosting, Or Does It Need To Be A VPS Or Dedicated Server?

This method uses SSH (secure shell, or “command line” access), so generally that means you can only use it with your dedicated or virtual dedicated hosting account. Some shared hosts do allow SSH access, so search your shared host’s support documents first.

Can I Use This To Download Torrents Or Other Nefarious Illegal Activites?

No. Remember the traffic is being routed through your website / server IP address, so anything you do can be traced back to that. You will also be using part of the bandwidth allocation of your hosting account, so downloading torrents would quickly push up the monthly hosting cost.

So Why Would I Want To Do This?

Sometimes you just want another IP address when you visit a website. This can be especially useful when faced with location-specific sites that block other countries. In other cases, your country may already be blocking access to various well known proxy providers, as is the case in China. The method described here will allow you to tunnel out of the offending country and go about your daily business without having every packet you send being inspected by the great firewall.


Setting Up SSH On Windows

I’ll start with Windows as the process is a little more complicated than on Mac OsX or Linux. In order to use SSH, you’ll need to download a special client software – in this tutorial I’ll use Putty. Go ahead and download the basic putty.exe file.

When you first open Putty, there’s a few settings to fill in. First is your server domain. If you have lots of domains set up on your private hosting account then go ahead and use any of them, but they’ll need to be SSH-enabled and remember that your login/password will be unique to each domain. I don’t suggest using the root account to log in under any circumstances, even if you have enabled it.

  1. Enter the server domain on the first screen.
  2. internet proxy server

  3. Click on the SSH label on the left sidebar. Make sure compression is enabled.
  4. ssh proxy tunnel

  5. Expand the SSH label to reveal additional settings. On the Tunnels screen, enter 9090 as the Source Port and change the destination to Dynamic.
  6. ssh proxy tunnel

  7. Head back up to the sessions screen where you first entered the domain. Enter a name for your settings in the text box below saved sessions, then hit save. You can now click on this saved session in future to reload all your settings.
  8. Finally, hit Open. There is no way to save your password and username, so you’ll need to re-enter these each time you open a connection. I also had problems pasting my password in, so if you do too then try typing it one character at a time. The first time you open the connection, you may get a warning error about authenticity of certificates and such. If so, ignore it and continue.

That’s it for Windows, leave the putty connection open and move onto configuring your browser.

ssh proxy tunnel


Setting Up SSH On Linux / OsX

Open up a terminal, and type the following command,

ssh -C2qTnN -D 9090

After you’ve typed in your password, that’s it. Leave the terminal open while you go on to configure your browser.

setting up ssh tunnel

Configuring The Browser

I’ll explain a couple of browsers here but basically you just need to change the settings for Connection -> Proxy to be a SOCKS5 proxy, with the url localhost and port 9090.


On Internet Explorer

Click the Tools -> Internet Options -> Connections tab. Tick Use a Proxy server and click Advanced. Fill in ONLY the SOCKS proxy as address localhost and port 9090

setting up ssh tunnel

On Firefox


Open up Preferences -> Advanced -> Network -> Settings -> Proxies. Select Manual proxy configuration. Fill out SOCKS Host and port.

setting up ssh tunnel

Alternatively, if you’re running a decent operating system like OsX, you can change the settings for system wide network access which will affect all browsers apps (this will also be opened for you if you attempt to change Chrome OsX proxy settings). From System Preferences, select your appropriate network interface (in my case, Ethernet). Under the proxies tab, tick to enable SOCKS proxy, then type in the details on the right.

internet proxy server

That’s wasn’t too hard was it? Of course, you could set this up with any remote linux computer How to Tunnel Web Traffic with SSH Secure Shell Read More really, but I wanted to demonstrate another of the many benefits to having your own private host over slow shared hosting, and just how powerful a few simple linux commands can be.

Remember, don’t do anything illegal with this method, as it can be traced back to your hosting account and is not designed to provide 100% anonymity.

Image Credit: ShutterStock

Related topics: Computer Networks, IP Address, Remote Access, VPN.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Andrae
    February 8, 2019 at 7:46 pm

    Thanks for sharing this. It worked great!

  2. Chris
    September 16, 2018 at 3:34 am

    I'm not much techie but using SSH just secured my browsing data but the data on my ISP will still be consumed right?

    • James Bruce
      September 17, 2018 at 10:50 am

      Yes, everything you do will count toward your data limit.

  3. jan
    April 6, 2018 at 10:16 am

    For some reason, this does not work for me. I dont have any domain in my VDS so I use IP address of the server and root account to log in via SSH. Otherwise, I do exactly the same as explained but no luck...

  4. Gregordy
    July 2, 2016 at 8:20 pm

    Thanks a million!

  5. Ankit Yadav
    June 10, 2016 at 5:28 pm

    This still works today. Thanks

  6. Anonymous
    August 10, 2015 at 11:12 am

    What about Chrome Browser? How do I configure Chrome browser's proxy settings

  7. nikolasjones9
    May 11, 2011 at 12:12 pm

    If you have your own virtual private server for hosting your website, you may not know you can also use it as a private proxy to get past.
    new cars

  8. Anonymous
    May 11, 2011 at 10:12 am

    If you have your own virtual private server for hosting your website, you may not know you can also use it as a private proxy to get past.
    new cars

  9. Vitony
    April 22, 2011 at 5:41 am

    Is internet access faster using this method rather than setting up the remote unit as a VPN server

    • James Bruce
      April 22, 2011 at 10:44 am

      depends very much on the speed of the servers you're comparing.

      Obviously, if you're running your SSH tunnel through a slow shared host, a dedicated VPN is going to be quicker.

      It really depends on your individual situation. Why not try both?

  10. Brent Japp
    April 21, 2011 at 5:44 pm

    You can setup putty to auto login by using SSH Auth Keys and using username@server for the destination host.

  11. jiazhuangde
    April 21, 2011 at 5:07 am

    welcome to our website:

    ------- --------

    if you like to order anything you like.

    More details,

    please just browse our website Quality is our Dignity;

    Service is our Lift.

    enjoy yourself.

    thank you!!

    ------- -----

  12. pceasies
    April 20, 2011 at 7:46 pm

    Dreamhost allows SSH access.

    Another huge advantage to do this is safe browsing from insecure hot spots. Everything sent through the tunnel will be encrypted and people doing packet sniffing at the hot spot (like FireSheep) won't be able to intercept anything passing through.

    You could also change the port to 8118 and use Tor button in Firefox, this forces everything, like DNS requests to go through the tunnel too. It also disables things that could reveal your real IP.