how can I SSH to a linux box and then port forward to a Windows box?

Joined
Oct 6, 2012
Messages
6
Reaction score
0
Points
1
I have direct access to a Linux box via ssh. I want to ssh to that box and then port hop to the RDP port on a windows machine and then connect to it with CoRD (or any RDP client for Mac) and use 127.0.0.1:33389

but I don't have the syntax right. Can anyone help me out with the command that I can use to connect to the Linux box and then hop over to the Windows machine on the new port?
 
OP
W
Joined
Oct 6, 2012
Messages
6
Reaction score
0
Points
1
just for reference, I was trying stuff like:

ssh -g -L 127.0.0.1:33389:LinuxBox:3389 user@WindowsBox
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
That will port forward your linux box 3389 to local 33389 - your linux box isn't running rdp.

Do you have ssh server running on your windows machine?

You'll have to ssh port forward from the windows box to the linux box -> then port foward that port outside.

something like -on your linux box
Code:
ssh -L 33389:windowsbox:3389 user@windowbox

Test on the linux box that you can open 127.0.0.1:33389 with an rdp client

Then you should be able to ssh to your linux box like you did
Code:
ssh -L 33389:linuxbox:33389 dynamicdns.computer.com

edit - I haven't fully tested this but you get the idea - first get the port forward to work on your linux box - then forward it again.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
Wait - this is coming back to me now. I think I have this wrong. Here is my original writeup
http://www.mac-forums.com/forums/in...s/196280-vnc-port-forwarding.html#post1025616

So from what I remember - you have your linux box setup as an SSH server - with port 22 forwarded. So if you go ssh [email protected] -> it goes to your ssh server on your linux box. Then if you want to get to your windows box you would do this

Code:
ssh -L 33389:192.168.1.2:3389 [email protected]

where 192.168.1.2 is your windows box. You don't need to do the double hop I described. So I think your original post was close - you just need to replace linuxbox ip with windows ip.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top