0

can someone explain how the following ssh tunneling is working ?

 ssh root@localhost -P 2222 -pw 1234 L 3300:remote_WIN_machine1:3389

this ssh command is running from Linux machine while the remote host is win machine

so I little confuse how it can be - create tunneling from Linux to win ? is it possible?

And if it true , once we create the tunneling Then what next? , what are the actions that we can do from Linux to win machine?

2 Answers 2

2

This looks like the linux host is configured to be some sort of RDP gateway. The command will initiate a SSH session to itself (root@localhost), start a local listener on port 3300 (L 3300:) to forward all traffic to a Windows machine on port 3389 (remote_WIN_machine1:3389), typical for RDP.

I suspect that the GatewayPorts directive is set to yes in /etc/ssh/sshd_config so the listener accept and forward traffic from remote hosts to the Windows host. In this case a remote host can access the Windows host through this linux host by starting a remote desktop session as rdesktop -u username linuxhost:3300

2
  • so , if I open ssh .... from my win machine to remote win machine , after that I can open RDP to remote WIN from my WIN machine ? May 20, 2015 at 6:51
  • No, in case that the ssh command is executed on the Linux host you could be able to start a RDP session from a Windows host 'to' the Linux host on port 3300 which will forward the RDP traffic to the remote_WIN_machine1.
    – Lambert
    May 20, 2015 at 8:31
1

Looks like you set up a some sort of proxy listening on TCP:3300 port and forwarding all the traffic to your remote Windows PC RDP (remote desktop) port.

Then all traffic goes to TCP:3300 will be forwarded to remote Windows PC at RDP port, so you can connect to it with regular RDP client.

You'll need to have existing network route to between Windows PC and Linux server of course.

If you need more info about SSH tunneling you can look here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .