How to set up ssh tunnel to bypass corporate proxy

Are you trying to access some harmless website that is blocked by your IT? Frustrating, isn't it? Well, read on, because this guide will open all the doors for you.

General notes

Please note, I assume that you already have an SSH server that you can connect to from outside world.
For the purpose of this article, I'm connecting to example.com on port 443. I'm using port 443 since all firewalls and proxies have this port open for ssl connections.

Apps required

  • PuTTy - You can download it here
  • PuTTy Tray - another version of PuTTy. The beauty of this app is that its window can be hidden and all you'll see is a little tray icon. If you're interested, you can get it here
  • Please note: If in the future you would like to launch this app from a command line or start menu just by typing 'putty', you should either download PuTTy to your %windir%\System32 or update your PATH system variable to include path to PuTTy's download directory.

    The Guide

    Part 1: PuTTy configuration

    To configure PuTTy, simply follow these simple steps and you'll be up and running in no time!
    1) Launch PuTTy and from the menu (on the left side) navigate to Connection | Proxy. This is where you are going to specify your company's proxy information. If you don't know it, you can get it from your Internet Explorer's settings. (Go to Tools | Internet Options | Connections Tab | LAN Settings button)
    2) Now, let's create a tunnel with a dynamic port that will be used by your browsers as a proxy configuration. To do that simply navigate to Connections | SSH | Tunnels. Then, for Source port put a port number of your choice; leave Destination blank; Select Dynamic radio button and click Add button to save your tunnel.
    3) Go back to the Session window (from the left-hand side menu) and type in your host name and port of the computer you are connecting to. For the purpose of this tutorial, Host Name = example.com and Port = 443.
    4) Under Saved Sessions type in the name of this configuration and press Save button.
    5) Press Open button to initiate a connection. When asked for your login and password, punch in your credentials

    Part 2: Browser Configuration

    Now that Putty is up and running, it's time to configure our browser to use our newly created tunnel as a proxy. To do that complete these 3 steps:
    1) Open up proxy configuration for your browser
    2) Under Address type in localhost and under port type in the port you've chosen in step 2
    3) Save your configuration and happy browsing!

    Please note, some companies might get very upset if they will find out that you're doing this, so use this at your own risk!

    Comments