How to Make Virtual Private Network (VPN) for SSH with Putty (2024)

Introduction

I have multiple Linux machines at my home. Previously, when I needed SSH access to these machines I used to setup port forwarding on my router to each of these machines. It was a tedious process of enabling port forwarding and then disabling it after use. It was also difficult to remember port number forwarded for a particular machine. But now I found a cooler way to get SSH access to all my machines at home without setting up port forwarding or remembering any port numbers and most importantly, I can address my home machines with local subnet IP address, no matter wherever I connect from the internet.

Requirements

  1. Remote machine with Putty installed in it.
  2. Home router’s internet accessible IP address or dynamic DNS (DDNS) address.
  3. One/more Linux/Windows machine(s) to which direct SSH access is required.
  4. On the router, port forwarding is enabled for SSH service to at least one of these machines.

Setup

The basic idea to get this working is that we make one initial SSH connection to our home machine. Then using this connection as a tunnel we can connect to any machines at home by addressing them with local sub-network address (such as 192.168.x.x). So the high level steps are:

  1. Open a putty session and configure it to act as a tunnel.
  2. From this session connect to your default SSH server at home.
  3. Open another putty session and configure it use the previous putty session as proxy.
  4. SSH connect to any machine at home using the local subnet IP address. Since we are using a proxy it will resolve the local subnet’s IP address properly.
  5. You can make any number of connections to all your home machines by just repeating steps (3) and (4).
    Note: If on the remote network’s subnet is same as your home network’s subnet then you might run into IP conflicts.
How to Make Virtual Private Network (VPN) for SSH with Putty (1)

Step-by-Step

1) On the remote system, open putty enter the IP address or dynamic DNS (DDNS) name in the host name field. Select “SSH” as connection type. Port 22 will be selected which can be left alone unless you run the SSH service on a different port. Note: Though your putty screen might look a little different than the one seen here due to version differences, the basic steps would be still the same

In our example,
Host Name = demo123.dyndns.org
Port= 22

How to Make Virtual Private Network (VPN) for SSH with Putty (2)

2) In putty, on the left-hand navigation panel, open SSH option and select “Tunnels”.

In the tunnels screen, set these values
Source Port: 3000 (this is the port at which our proxy service listens to, this port can be changed to any but preferably a number larger than 1024)
Destination Port: (Leave Blank)
Finally, select “Dynamic” from the radio button options.

How to Make Virtual Private Network (VPN) for SSH with Putty (3)

3) Important: Click “Add” to add the tunnel settings to the connection.

How to Make Virtual Private Network (VPN) for SSH with Putty (4)

4) On left-hand navigation panel, move the scrollbar to the top and click session. You will be seeing the settings entered in step(1). Now we can save the whole connection settings. Add a name for this connection in the saved sessions textbox and click save.

How to Make Virtual Private Network (VPN) for SSH with Putty (5)

5) Click open, to open connection to home machine, and enter login and password information for the remote machine. This user need not be root user, but it needs to be an user with network access on the remote machine. That brings to the end of putty configuration. Now you have a proxy tunnel connection from remote machine to one of the home machine. Now we are ready to connect to any home machine.

6) Open another putty session. Select the options “Proxy” from the navigation panel. On the right-side proxy options, enter only the following information. Don’t change any other settings.
Proxy type : select “SOCKS 4”
Proxy hostname : enter “localhost”
Port : 3000

How to Make Virtual Private Network (VPN) for SSH with Putty (6)

7) Click on the “Session” option from the navigation panel. Enter a name under “Saved Sessions” text field. Don’t enter any information in the “Host Name” field. Now click “Save”. Now we have a template connection session using our proxy.

How to Make Virtual Private Network (VPN) for SSH with Putty (7)

8 ) Now enter local subnet IP address of a machine at home and click open. The connection gets routed through the proxy tunnel and you will be connected to the home machine directly. Similarly you can connect to another home machine by opening putty and loading the template we created and just filling in the machine’s local subnet IP address.

How to Make Virtual Private Network (VPN) for SSH with Putty (8)

BTW, if you think just SSH access is not cool enough, you can do more cool stuff like

  • Listening to music stored at home
  • Viewing/sharing photos at with friends and family
  • Creating schedules, Todos, notes etc., securely at a home computer

To get these functionalities checkout this free utility called Tonido. For more information on different applications bundled with Tonido you can read more Tonido related blog posts here.

How to Make Virtual Private Network (VPN) for SSH with Putty (2024)

FAQs

How to Make Virtual Private Network (VPN) for SSH with Putty? ›

VPNs and SSH systems both create secure “tunnels” for your data to travel through. These tunnels ensure that nobody other than the intended recipient can view or alter your data. However, while an SSH connection only works on an application level, a VPN connection encrypts and protects all your data.

How to create SSH tunnel using PuTTY? ›

Procedure
  1. Locate the certificate file for your client-side bastion host. ...
  2. To set up SSH tunneling, download and launch PuTTY.exe. ...
  3. Select Session from the left pane. ...
  4. Select Connection > Data from the left pane. ...
  5. Select Connection > SSH > Auth from the left pane. ...
  6. Select Connection > SSH > Tunnels from the left pane.

How to use SSH tunnel as VPN in Linux? ›

  1. Download OpenVPN profiles. First download the OpenVPN profiles for use with SSH and extract it. ...
  2. Start SSH. For SSH to verify the connection, the known_hosts file is required. ...
  3. Start OpenVPN. Now you can start OpenVPN in a new terminal: ...
  4. Test the VPN connection. Now test whether your VPN connection is working correctly.

How to set up SSH socks tunnel for private browsing? ›

Step 1 (Windows) — Setting Up the Tunnel
  1. From the Session section, add the Host Name (or IP address) of your server, and the SSH Port (typically 22)
  2. On the left, navigate to: Connection > SSH > Tunnels.
  3. Enter any Source port number between 1025 and 65536 , such as 1337.
  4. Select the Dynamic radio button.
  5. Click the Add button.
Feb 21, 2024

How do I use PuTTY as a VPN? ›

So the high level steps are:
  1. Open a putty session and configure it to act as a tunnel.
  2. From this session connect to your default SSH server at home.
  3. Open another putty session and configure it use the previous putty session as proxy.
  4. SSH connect to any machine at home using the local subnet IP address.

How to generate SSH private key PuTTY? ›

Generating SSH key pairs locally
  1. Download PuTTYgen (available here) and run the executable.
  2. Click on the Generate button and follow on-screen instructions.
  3. Create and confirm a Key passphrase.
  4. Save public and private keys. Saving the public key with the extension . ...
  5. Upload the public key file.

Is an SSH tunnel like a VPN? ›

VPNs and SSH systems both create secure “tunnels” for your data to travel through. These tunnels ensure that nobody other than the intended recipient can view or alter your data. However, while an SSH connection only works on an application level, a VPN connection encrypts and protects all your data.

How to create a VPN connection in Linux? ›

Set Up a Linux VPN Server With Hostinger OpenVPN VPS Template
  1. Log in to hPanel and click VPS on the top menu.
  2. Select the VPS you want to install OpenVPN on.
  3. Navigate to the sidebar → OS & Templates → Operating System.
  4. Click Applications.
  5. Select Ubuntu 22.04 64bit with OpenVPN from the drop-down menu and click Change OS.
Mar 20, 2024

How do I setup a SSH tunnel server? ›

In Windows - putty
  1. Click the plus sign by the SSH menu choice in the left pane of the main window.
  2. Click on Tunnels.
  3. Set Source port to the value of the listen port and Destination to DESTINATION_HOST:DESTINATION_PORT given your specific tunneling options. (

How to create SSL VPN tunnel? ›

You must allow access to some services for remote users from the required zones.
  1. Go to Administration > Device access.
  2. Under SSL VPN, select WAN to allow remote users to establish SSL VPN connections.
  3. Under User portal, select the following: ...
  4. (Optional) Under Ping/Ping6, select VPN. ...
  5. Under DNS, select VPN. ...
  6. Click Apply.
May 28, 2024

How do I create a VPN configuration? ›

Set Up a VPN on a PC
  1. Use the Windows Store or internet to download a VPN app.
  2. Move into “Settings” and click on “Network” and then “VPN.”
  3. Click “Add a VPN” and fill out the fields for “Server Name,” “VPN Type” and your account information, which should be shared by the VPN provider you chose.
  4. Save your VPN.
Jan 30, 2024

How to create a VPN in IKEv2? ›

Go to Settings -> Network & internet -> VPN, then tap the "+" button. Enter a name for the VPN profile. Select IKEv2/IPSec RSA from the Type drop-down menu. Enter Your VPN Server IP (or DNS name) in the Server address field.

How to use SSH tunnel in PuTTY? ›

Open up the PuTTy program. For “Host Name”, enter the hostname / domain or IP of the server you want to connect to. Click through “Connection” > “SSH” > “Tunnels” from the “Category” panel. Under “Source port” put down the local port number you want to connect to for forwarded traffic.

How to use PuTTY as proxy? ›

First, open PuTTy. For “Host Name” enter the domain name or IP address of the server that will act as the proxy. From the “Category” section on the left, scroll to “Connection” > “SSH” > “Tunnels”. Enter the local port you want to use for the proxy connection in the “Source port” field.

How to use SOCKS5 with SSH? ›

How to Run SSH via SOCKS Proxy?
  1. Launch PuTTY.
  2. Click on Proxy on the PuTTY configuration sidebar menu.
  3. In the proxy type section, select SOCKS5.
  4. Fill in the Proxy hostname section.
  5. Click on Session in the sidebar menu.
  6. Choose SSH in the connection type section.
  7. Enter the connection details of the SSH server.
  8. Click Open.
Nov 26, 2022

How to create a tunnel in SSH? ›

In Windows - putty
  1. Click the plus sign by the SSH menu choice in the left pane of the main window.
  2. Click on Tunnels.
  3. Set Source port to the value of the listen port and Destination to DESTINATION_HOST:DESTINATION_PORT given your specific tunneling options. (

How to create SSH session in PuTTY? ›

How to Establish SSH Connection Using PuTTY
  1. Launch the PuTTY SSH client, then enter your server's SSH IP and SSH Port. Click the Open button to proceed.
  2. A login as: message will pop up and asks you to enter your SSH username. For VPS users, this is usually root. ...
  3. Type your SSH password and press Enter again.
Nov 27, 2023

How to use SSH command in PuTTY? ›

Start by opening PuTTy. Enter your hostname or IP address into the provided field and set the SSH port to 22. Next, click the Open button to open the command line window. In the command line window, type in the SSH username at the login as prompt and then press enter on your keyboard.

How do I tunnel remote desktop in PuTTY? ›

In the PuTTY Configuration window, navigate to the “Connection” category. Expand the “SSH” menu and select “Tunnels.” Enter the Destination with port “localhost:3389” since RDP typically listens on port 3389. Make sure the “Local” radio button is selected.

Top Articles
Easy Peanut Butter Fudge Recipe - No Candy Thermometer Required!
3 Minute Coconut Mounds Fudge Recipe - Lou Lou Girls
Joe Taylor, K1JT – “WSJT-X FT8 and Beyond”
Play FETCH GAMES for Free!
Pet For Sale Craigslist
Skycurve Replacement Mat
Brady Hughes Justified
Jazmen Jafar Linkedin
Meer klaarheid bij toewijzing rechter
Pickswise the Free Sports Handicapping Service 2023
PGA of America leaving Palm Beach Gardens for Frisco, Texas
Natureza e Qualidade de Produtos - Gestão da Qualidade
Turbocharged Cars
Keurig Refillable Pods Walmart
Signs Of a Troubled TIPM
Echo & the Bunnymen - Lips Like Sugar Lyrics
Moparts Com Forum
Maplestar Kemono
Vanessa West Tripod Jeffrey Dahmer
Fool’s Paradise movie review (2023) | Roger Ebert
Urban Airship Expands its Mobile Platform to Transform Customer Communications
Music Go Round Music Store
Forest Biome
Toyota Camry Hybrid Long Term Review: A Big Luxury Sedan With Hatchback Efficiency
College Basketball Picks: NCAAB Picks Against The Spread | Pickswise
Craigs List Tallahassee
Tips and Walkthrough: Candy Crush Level 9795
[PDF] PDF - Education Update - Free Download PDF
Jermiyah Pryear
Breckiehill Shower Cucumber
Tokyo Spa Memphis Reviews
Bj타리
Stockton (California) – Travel guide at Wikivoyage
lol Did he score on me ?
Experity Installer
DIY Building Plans for a Picnic Table
Panchitos Harlingen Tx
Bridger Park Community Garden
Top-ranked Wisconsin beats Marquette in front of record volleyball crowd at Fiserv Forum. What we learned.
Admissions - New York Conservatory for Dramatic Arts
The Thing About ‘Dateline’
Xxn Abbreviation List 2023
Oppenheimer Showtimes Near B&B Theatres Liberty Cinema 12
Despacito Justin Bieber Lyrics
Payrollservers.us Webclock
Coffee County Tag Office Douglas Ga
Rs3 Nature Spirit Quick Guide
Lyons Hr Prism Login
Ups Customer Center Locations
Syrie Funeral Home Obituary
Craigslist Pets Charleston Wv
Tanger Outlets Sevierville Directory Map
Latest Posts
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 5760

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.