KB 322346 - Accessing Services Running on a Different Network via Jumphost using SSH Local Port Forwarding

KB 322346 - Accessing Services Running on a Different Network via Jumphost using SSH Local Port Forwarding

Objective

Learn how to access services hosted on a remote network (such as an internal web server or application) from your local machine by leveraging a jumphost (also known as a bastion host) and SSH local port forwarding.

What is SSH Local Port Forwarding?

SSH local port forwarding creates a secure tunnel between your local machine and a remote server (via the jumphost). This tunnel allows you to securely access services running on the remote network by forwarding your local port traffic through the SSH connection.

Requirements

✅ Local machine with SSH client (Linux/macOS terminal or Windows PuTTY).
✅ SSH credentials for the jumphost.
✅ Access to the remote service from the jumphost.

Steps to Access the Remote Service

1️⃣ Identify the Remote Service and Jumphost Details

  • Remote Service Host IP/Hostname: 10.5.1.102

  • Remote Service Port: 80 (HTTP example)

  • Jumphost IP/Hostname: 100.105.71.94

  • Jumphost Username: user (replace with actual username)

Using SSH Local Port Forwarding (Linux/macOS)

Open a terminal and run:

  1. ssh -L 8080:10.5.1.102:80 user@100.105.71.94

Explanation:

  • -L 8080:10.5.1.102:80:

    • Listen on your local port 8080.

    • Forward traffic to the 10.5.1.102:80 service through SSH.

  • user@100.105.71.94:

    • Replace user with your actual SSH username.

This creates a secure tunnel from your local port 8080 to the remote service.


Access the Service in Your Local Browser

Open your browser and navigate to: http://localhost:8080

 Using PuTTY on Windows

If you’re using PuTTY, follow these steps:

1️⃣ Open PuTTY and enter the jumphost IP: 100.105.71.94.
2️⃣ In the Category tree, navigate to: Connection > SSH > Tunnels (see step 1,2,3 on below screenshot)

 3️⃣  In the Source port field, enter: 8080
4️⃣ In the Destination field, enter: 10.5.1.102:80
5️⃣ Select the Local radio button and click Add.
6️⃣ Return to the Session category and click Open to start the SSH session.
7️⃣ In your browser, go to: http://localhost:8080