The information in the other answers was not working or was unclear.
For the following situation:
your local host --> ssh server (tunnel) --> Windows VM supporting RDP
and assuming that RDP port is open on the Windows VM, and assuming that ssh is setup on the ssh server, you have two options to use remmina for RDP over an ssh tunnel through the ssh server:
- create the tunnel outside of remmina, and use remmina just for the RDP over that tunnel
- create the tunnel in remmina and remmina uses it for its RDP
First get method 1 to work, as it is easier to setup IMO.
For method 1, you first need the following:
ssh -i PATH_TO_PRIV_KEY_OF_SSH_SERVER -L LOCAL_PORT:PRIVATE_RDP_IP:RDP_PORT SSH_SERVER_USER@SSH_SERVER_DOMAIN_NAME
You could put those command line params in your ~/.ssh/config
so you can just write ssh YOUR_ALIAS
. But it is not useful to method 2 and that info is easily found on the net (chatGPT does a good job of converting CLI params to ssh config file syntax).
But basically for method 1 you need to tell ssh
- which private key to use (
PATH_TO_PRIV_KEY_OF_SSH_SERVER
)
- local port to use (
LOCAL_PORT
)
- the private IP of the Windows VM (
PRIVATE_RDP_IP
) that you want to reach through the SSH tunnel
- the port that RDP is listening on the Windows VM (
RDP_PORT
)
- the user name on the SSH server (
SSH_SERVER_USER
)
- the SSH server domain name (
SSH_SERVER_DOMAIN_NAME
)
This assume ssh on the SSH server is listening on port 22, otherwise specify that too.
Once you have that ssh command working, you will end up at a terminal prompt on the SSH server. As long as you have a shell with that prompt, the tunnel is active.
Now setup remmina with method 1, since that setup is super easy: set the Server
in Basic
tab to localhost:$LOCAL_PORT
, and the username and password for remote desktop into the Windows VM. The BASIC tab looks like this in Remmina 1.4:
The tricky part for me was method 2:
- After having setup method 1, right click the Remmina RDP connection config in the remmina window, make a copy, give it a new name (I add the word tunnelled to mine)
- Edit the entry
- On the
Basic
tab, change Server
to the value of PRIVATE_RDP_IP:RDP_PORT
, eg 10.0.0.1:3389
- On the
SSH Tunnel
tab,
- Enable the SSH tunnel
- In
Custom
, put the value of SSH_SERVER_DOMAIN_NAME
- In
Username
put the value of SSH_SERVER_USER
- In
SSH Identity file
navigate to your private key file and select it
The SSH Tunnel looks like this:
Save and click connect. The first time, you will be asked to accept the host then RDP will start. Subsequent connections do not ask to accept.
You do not need to add the private key to an ssh-agent for this to work. Basically after you boot up your local host and open Remmina, you can connect.