Setting up Possible Route for Traffic: Connecting Local PC to AWS Instance using Port Forwarding with PuTTY

Abstract: Solve local access to AWS Lightsail services by configuring SSH port forwarding with PuTTY.

Created: 2026-09-25 by
Port forwarding with PuTTY allows you to securely connect a local Windows 11 machine to an Ubuntu AWS Lightsail instance by tunneling network traffic through SSH. This method bypasses the need for direct public exposure of local services, ensuring that data remains encrypted during transit while enabling seamless access to remote resources as if they were local.

Prerequisites and Instance Configuration

Before configuring PuTTY, ensure your AWS Lightsail instance is running and accessible. You must have the private IP address or public DNS name of your Ubuntu LTS 20.04 instance, along with valid login credentials. Typically, this involves using the ubuntu username for initial access. Verify that the instance's firewall settings allow incoming SSH connections on port 22 from your current IP address. If you are planning to forward specific ports for web services or databases, ensure those ports are also open in the Lightsail networking tab. This foundational step prevents connection timeouts caused by security groups blocking the initial handshake.

Configuring PuTTY Session Settings

Launch PuTTY and enter the hostname or IP address of your AWS instance in the "Host Name (or IP address)" field. Set the connection type to SSH and ensure the port is 22. Navigate to the Connection category in the left-hand menu, then select Data. Enter ubuntu in the "Auto-login username" box to streamline the authentication process. Under the SSH category, click on Tunnels. This section is critical for establishing the port forwarding rules. Here, you will define how traffic from your local machine is redirected to the remote instance. Ensure that "Enable SSH agent forwarding" is unchecked unless specifically required for git operations, as this can sometimes cause permission issues with local keys.

Setting Up Local Port Forwarding

Local port forwarding maps a port on your local Windows PC to a port on the remote Linux server. In the Tunnels section, select the Local radio button. In the "Source port" field, enter a local port number that is not currently in use by another application, such as 8080. For the "Destination" field, specify the target host and port on the remote server. For example, if you want to access a web server running on the AWS instance at port 80, enter localhost:80. Click Add to register this rule. The tunnel entry should now appear in the list below. This configuration tells PuTTY to listen on your local port 8080 and forward any incoming connections to port 80 on the remote instance.

Establishing the Connection and Testing

Return to the Session category and save your configuration by giving it a name in the "Saved Sessions" box. Click Open to initiate the connection. Upon successful authentication, a terminal window will appear, indicating that you are logged into the Ubuntu instance. To test the port forwarding, open a web browser on your Windows PC and navigate to http://localhost:8080. If configured correctly, you should see the content served by the web application running on the AWS instance. This confirms that the traffic has been successfully tunneled through the encrypted SSH channel. You can verify the active tunnels by checking the PuTTY window title bar, which typically displays the active port forwarding rules.

Advanced Tunneling Options

While local forwarding is common, dynamic port forwarding via SOCKS proxies offers greater flexibility for browsing multiple remote services. Select the Dynamic radio button in the Tunnels menu and set a source port, such as 1080. Add this tunnel and connect. Configure your system-wide proxy settings or individual applications like Firefox to use a SOCKS5 proxy at 127.0.0.1:1080. This routes all application traffic through the SSH tunnel, effectively masking your origin IP for those applications. Note that this requires careful configuration of client applications to respect the proxy settings. For most single-service needs, local forwarding remains the more straightforward and secure option.

Security Best Practices

Always keep your PuTTY software updated to mitigate known vulnerabilities. Use strong, complex passwords or, preferably, SSH key pairs for authentication to prevent brute-force attacks. Disable password authentication on the AWS instance if possible, allowing only key-based logins. Regularly review the active sessions and terminated connections in the AWS console to detect unauthorized access attempts. Additionally, consider using a firewall on the Ubuntu instance to restrict access to forwarded ports to trusted IP addresses only. These measures ensure that the convenience of port forwarding does not compromise the security of your cloud infrastructure.

Frequently Asked Questions

Can I forward multiple ports simultaneously?

Yes, you can add multiple entries in the Tunnels section before connecting. Each entry requires a unique local source port but can point to different destinations or the same destination on different ports. This allows you to access various services like SSH, HTTP, and database interfaces concurrently through separate local ports.

Why does my browser show a connection refused error?

This usually indicates that no service is listening on the specified destination port on the remote server, or the firewall is blocking it. Verify that the application on the Ubuntu instance is running and bound to the correct interface. Check the Lightsail firewall rules to ensure the specific port is allowed inbound traffic.

Is port forwarding safe for production environments?

Port forwarding itself is secure because it uses encrypted SSH channels. However, exposing internal services directly to the internet via forwarding should be done cautiously. It is best suited for administrative access or development environments rather than public-facing production endpoints. Always combine it with strong authentication and network segmentation.

How do I remove a saved session in PuTTY?

Open PuTTY, go to the Saved Sessions list, highlight the session you wish to delete, and click the Delete button. This removes the configuration from the registry without affecting the actual connection history or logs. Be sure to export important configurations before deleting them if you might need them later.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More