Tunneling by Example

ssh -g -L 8888: localhost

I am saying on my localhost(any Linux box) , i want the port 8888 to be listening only to incoming connections to .

So if anyone connects to my localhost on port 8888, my localhost will forward the connection to on port 3389.

Port 3389 is the Windows RDP port number, so the example above is an rdp connection to the windows box

So the connection would look like this below

where MyWin is the localhost