Thursday, December 19, 2024
HomeUNIXAccess remote TCP ports with OpenSSH tunnels

Access remote TCP ports with OpenSSH tunnels

Using OpenSSH, it is possible to access TCP ports on remote systems, even those not on the host you are ssh’ing to, using tunnels.

If the remote system you are connecting to with shh is called ‘sadie’ and the target host with the desirable TCP port of 1433 is named ‘molly’ the command to build the tunnel between them is:

ssh -L 1433:molly:1433 sadie

Once you authenticate with ssh, you can access port 1433 on molly as though it were on your system. Make sure that the remote system (sadie) can resolve the name of the target system (molly). You can use IP addresses instead of names.

Quinn McHenry
Quinn McHenry
Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!