• About Binary Impulse
  • BashBytes
Binary Impulse

SSH Tunneling on Windows Using PuTTY

July 11, 2013 9:42 AM / 1 Comment / Don Oerkfitz

Imagine if you will; you are at work or school and you need to access a site, but its blocked. So being the tech savvy person you are you try a proxy tunnel and that too is blocked.  What do you do?

You create an SSH tunnel proxy on your own machine!

First off, in order to do any of this regardless of your Operating System you need:

  1. an SSH Server
  2. a knowledge of how to configure your computer / browser to use the proxy
  3. some knowledge of writing scripts (optional if you want to run stuff when you startup your computer)

 

Now, if you are on linux or mac it is simple as opening the terminal and running:

ssh -D 55555 user@your.ssh.server

Then just point your browser or computer system network settings over to 127.0.0.1 port 55555 it will look like this (on firefox):

2013-05-16 15_25_03-Connection Settings

However, if you are an unfortunate Windows OS user, your situation isn’t as easy. Sure, you could install Cygwin to get ssh on windows; but that just takes a lot of time and configuring and who has the patience for that?! So instead you use the easiest SSH tool for windows: PuTTY.

PuTTY is a simple executable file that lets you connect to ssh servers easily and effectively. It also allows you to store “Sessions” with special settings for the servers you connect to, but all that can be looked at on your own; now back to the topic at hand.

In order to make connecting to your server as simple as possible I created a script that can be ran. You can even edit this script to include some other programs you want to “auto-launch” once you have the proxy up and running.

Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("Path\To\putty.exe -ssh -D 55555 user@your.ssh.server -pw passwordHere")
'Put other autorun code here
Set objShell = Nothing

(take care to replace all the necessary variables in the objShell.Run command i.e. Paths, Passwords, Users, etc.)

now copy this code and paste it into a file and name the file WhateverNameYouWant.vbs (the .vbs portion is crucial as it is how the script will be able to execute). Execute the script and then you’re almost done. All that is left is to configure whatever program (as long as it supports a SOCKS5 proxy) to use the proxy.  Again to do it on firefox:

2013-05-16 15_25_03-Connection Settings

Make sure to leave PuTTY up and running, if you close it out it causes your proxy to shutdown as well.

NOTE: configuring your browser to use the proxy in the way shown above will cause all your traffic all the time to be sent through the proxy.  If you want a way to toggle between proxy and no proxy install an addon onto the browser (I recommend FoxyProxy, it’s compatible with both Firefox and Chrome).

 

I hope you have enjoyed this little tutorial and if you have any questions leave a comment down below.

Posted in: How-To's

One Thought on “SSH Tunneling on Windows Using PuTTY”

  1. Valentin on November 14, 2017 at 10:38 PM said:

    Don Oerkfitz your script works perfectly but you can simplify it even further without the need of VB script. You can use a batch file (file.bat) having this simple line:

    Path\To\putty.exe -ssh -D 55555 user@your.ssh.server -pw passwordHere

    Kind regards,
    Valentin

    Reply↓

Leave a Reply Cancel reply

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

Are you an intelligent human being? * Time limit is exhausted. Please reload CAPTCHA.

Post Navigation

← Previous Post
Next Post →

Pages

  • About Binary Impulse
  • BashBytes

Recent Posts

  • My UBook X Linux Tablet Adventure and how I learned more than I ever thought I would need to know about accelerometer drivers
  • Migrating Proxmox Hypervisor’s Boot Volume ZFS Mirror To New (Smaller) Disks
  • OPNsense Performance Tuning for Multi-Gigabit Internet
  • Reddit Deplatforms Popular Microsoft Software Swap Subreddit
  • Comcast Upgrades Gigabit Pro from 3Gbps to 6Gbps!
July 2013
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  
« Jun   Sep »

Recent Comments

  • jasonistre on OPNsense Performance Tuning for Multi-Gigabit Internet
  • Nick on OPNsense Performance Tuning for Multi-Gigabit Internet
  • Kirk Schnable on OPNsense Performance Tuning for Multi-Gigabit Internet
  • nick on OPNsense Performance Tuning for Multi-Gigabit Internet
  • Eric on My UBook X Linux Tablet Adventure and how I learned more than I ever thought I would need to know about accelerometer drivers

Categories

  • How-To's
  • Humorous
  • Musings
  • Newsworthy
  • Other

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© Copyright 2025 - Binary Impulse
Infinity Theme by DesignCoral / WordPress