Operations 3 min read

Speed Up Cross‑Data‑Center Access with SSH Tunnels and Port Forwarding

This guide explains how to use SSH local port forwarding to create a fast, secure bridge between distant data centers, allowing you to access slow remote services through a fast intermediary server and even transfer files via SCP over the tunnel.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Speed Up Cross‑Data‑Center Access with SSH Tunnels and Port Forwarding

Reference: http://blog.creke.net/722.html

Background: Several data centers have varying network speeds, so the fastest center is usually chosen as the VPN entry point. Direct VPN access to other centers can be slow, prompting the use of an SSH tunnel as a temporary solution.

Use case: Accessing idc1-server1 is fast, while accessing idc2-server2 directly is slow, yet the connection from idc1-server1 to idc2-server2 is quick. Therefore, idc1-server1 is used as a jump host.

ssh -i /path/to/sshkey -l username -f -N -T -L 8088:idc2-server2:80 idc1-server1

After running this command, opening http://localhost:8088 in a browser forwards the request to http://idc2-server2 through the secure tunnel.

Key parameter: -L 8088:idc2-server2:80 forwards a local port (8088) to port 80 on the remote host idc2-server2. The local machine listens on the specified socket; any connection is encrypted and sent via the tunnel (through idc1-server1) to the target.

ssh -i /path/to/sshkey -l username -f -N -T -L 2022:idc2-server2:22 idc1-server1

With this tunnel, files can be transferred using SCP through the jump host:

scp -i /path/to/sshkey -P 2022 upload_file_name.tgz dong@localhost:/path/to/upload/
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

networklinuxport forwarding
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.