This project is read-only.

Urgent Problem With Remote Port Forward + RDP

Sep 24, 2013 at 6:35 PM

First off, I want to say thanks for the great job on this library. It's really well-designed and handy.

I have 2 PCs running on windows 7 ultimate, which I'm using one as server and the other as client. On the server I've installed freesshd (as ssh server on port 22) and Bitvise ssh server (as another ssh server on port 22222). on the client I have written this small app to be able to do remote port forwarding.

Here is the code for app on the client :
PasswordAuthenticationMethod pam = new PasswordAuthenticationMethod(user, pass);

// socketPortNo can be 22 or 22222 depending on which ssh server, I'm trying to connect

ConnectionInfo ci = new ConnectionInfo("", socketPortNo, user, pam);

client = new SshClient(ci);
client.ErrorOccurred += new EventHandler<Renci.SshNet.Common.ExceptionEventArgs>(client_ErrorOccurred);
client.HostKeyReceived += new EventHandler<HostKeyEventArgs>(client_HostKeyReceived);


client.KeepAliveInterval = new TimeSpan(0, 0, 10);

fwdPort = new ForwardedPortRemote(IPAddress.Loopback, 17001, IPAddress.Loopback, 3389);
fwdPort.Exception += new EventHandler<Renci.SshNet.Common.ExceptionEventArgs>(fwdPort_Exception);
fwdPort.RequestReceived += new EventHandler<PortForwardEventArgs>(fwdPort_RequestReceived);

Client connects to server just fine. To test it, I've managed run commands on the host (Bitvise SSH Server is fine, freesshd tells me that it cannot run command, because it failed in running the process) and been able to connect as sftp client and create, upload and download files.

Remote port forwarding seems to work fine too. I've seen that port 17001 is open on server, and managed to redirect web traffic to it, so that browsing on server returns my hosted website on client (sometimes there were payload cannot be more than 32768 bytes error, but I increased max payload size in source code of sshNet and it went away and is working fine).

The problem is with RDP! everytime that I'm doing RDP from server (mstsc /admin 17001), it asks me the credentials for remote session, displays welcome message, and just dies there at the exact same place each time I try (and by dying I mean the picture freezes and after about 2 minutes the remote desktop closes automatically)

To make things clear :
  1. I was able to do port forwarding with putty, but it appears that putty has a well-documented bug when it comes to RDP. so no luck testing with putty
  2. I was able to do port forwarding with Bitvise SSH Client to both freesshd and Bitvise SSH Server and succeeded in RDP each time without any problems.
So, after wasting almost 4 days struggling with RDP, wireshark, ... I don't even have a clue what is going on here, can you please help me out?

Thanks in advance