One-click SSH Tunnel with RDP from Linux to a remote Windows PC

Related: Windows to Windows SSH / RDP


Assumes Linux laptop to connect to a remote PC such as:

On the Linux laptop:

apt install freerdp2-x11

If this has connection issues, you can fall back to using freerdp-x11.

Example

Remote PC IPRemote PC SSH portRemote PC RDP port
1.2.3.422 (open TCP firewall)3389 (blocked by remote PC firewall)

Create executable script myrdp.sh on the Linux laptop:

#!/bin/sh

ssh -f -L 4389:localhost:3389 remoteusername@1.2.3.4 sleep 1;

xfreerdp /v:localhost:4389

Running that script on the Linux laptop connects using RDP to the Windows desktop over the SSH tunnel

Notes

  • Advanced freerdp configuration (e.g. limited bandwidth)
  • xfreerdp command line options
  • Try freerdp-x11 if freerdp2-x11 errors with:

    [ERROR][com.freerdp.core] - freerdp_check_fds() failed - 0
    [INFO][com.freerdp.client.x11] - Network disconnect!
    [ERROR][com.freerdp.client.x11] - Failed to check FreeRDP file descriptor
    
    [ERROR][com.freerdp.channels.cliprdr.client] - cliprdr_order_recv failed with error 1359!
    [ERROR][com.freerdp.core] - cliprdr_virtual_channel_client_thread reported an error. Error was 1359
    
  • freerdp2-wayland on Wayland didn’t work for me.