Feed on Posts or Comments

Linux & Darwin & MacOS Daantje on 22 Feb 2005 07:10 pm

How to make a secure SSH tunnel

This is how you can make a SSH tunnel to an other machine in an other network. This is my situation:

my-local-machine -> my-router -> INTERNET <- remote-router <- remote-local-machine

Syntax:
ssh -g -L [my-local-port]:[remote-local-machine]:[remote-local-port] [username]@[remote-router]

Example:
I do this on my local machine…

ssh -g -L 81:192.168.1.2:80 user@remote.router.wan.ip

Now you can do in your own browser http://localhost:81 and you should
get the webserver on the remote-local-machine from the other network.
This you can do with any local port to any remote port, only remember
that the local port should not be in use allready. This works on all Linux, MacOS-X and Unix systems.

Trackback | Comments RSS Feed

Leave a Reply

You must be logged in to post a comment.