13

I'm using SSH tunnel and remmina client to connect to the remote machine.

First I open the tunnel in my terminal:

ssh -L 3309:<server_address>:3389 user@<aws_bastion>

And then I just connect via remmina to localhost:3309 port with user name and password for that server. It works just fine.

I wonder if I could setup this SSH tunnel bit in remmina directly

I've tried to specify the following

Tunnel setup screen

And then connect to my <aws_bastion> server and it doesn't work. I wonder how do I translate that tunnel command in GUI client?

5 Answers 5

7

It works in my case and I think the strange configurations are:

  • In SSH Tunnel, best use the SSH Agent based authentication.
  • In Basic settings, the server should start with localhost even though I put the server's IP in SSH Tunnel.

Hope this helps.


Update with the configuration that worked for me:

  • Basic tab.

    This depends on the vnc server setup in the remote.

    • Server: localhost:5900 (assuming the vnc server listen to localhost at port 5900)
    • User password: Your vnc password
  • SSH Tunnel:

    • Tick Enable SSH tunnel.
    • Choose custom: VNC_SERVER_IP_ADDRESS:22 (22 is the port for SSH)
    • In SSH Authentication: depending on the remote ssh configuration, use password or use SSH Agent.
5
  • Would you mind elaborating a bit what you put in which field exactly? I'm trying to recreate your solution, but it just hangs at the connecting dialog.
    – fifaltra
    Aug 1, 2020 at 13:31
  • Hi @fifaltra, which part of it is unclear? Have you succeed without Remmina (I mean, manually create a ssh tunnel and connect to it, as mentioned in the question)?
    – taper
    Aug 2, 2020 at 16:17
  • yes, it works manually, but I can't figure out what should go in which field to get remmina to connect with the ssh tunnel setting.
    – fifaltra
    Aug 3, 2020 at 14:04
  • I update with my config. Can you try that? @fifaltra
    – taper
    Aug 3, 2020 at 16:02
  • If you use ssh keys for authentication, make sure to select the ssh private key file (id_rsa).
    – rvimieiro
    Dec 1, 2021 at 22:16
3

You don't need to open ssh tunnel yourself (anymore?). Remmina, at least the current version 1.4.2, does it for you.
Here is my configuration which just works: enter image description here

1
  • I tried that and it did not work unfortunately. It could not establish connection and there is no way to specify verbosity level to troubleshoot connection problems.
    – ruslaniv
    Jul 26, 2023 at 5:34
1

While I don't think Remmina supports setting up the initial SSH tunnel, you could always just run a script for it. Something along the lines of:

!/bin/bash ssh -L 3309:<server_address>:3389 user@<aws_bastion> remmina -c (connectionname)

You'll need to make a connection file specific to your connection, of course, but afterward this script should initiate the tunnel and connect to the specified machine in one swoop.

https://superuser.com/questions/628371/how-to-run-linux-remmina-from-the-terminal

This link details how to create such a configuration file.

2
  • Nice, this is what I ended up with. Thank you for the link for remina files.
    – Pavel K
    Dec 15, 2018 at 19:36
  • 3
    As of now (2021), Remmina does indeed support SSH tunnels.
    – moi
    Jun 3, 2021 at 12:05
0

Scenario: localhost => jumpbox => RDP-host

If you want to connect via a Jumpbox to an isolated RDP Server, (which accepts only RDP connections coming from the Jumpbox) I had success with the following Remmina configuration.

Step 1: In a gnome-terminal, enter

ssh my.jumpbox.com -L 1111:my.rdp-windows.server:3389

Note: (If you don't need an intermediate host: Instead of my.jumpbox.com you could also enter your own machine name (I think this is then called a 'loopback connection')- (This assumes that you have an entry in your ~/.ssh/config file. To make the connection more explicitly, enter

ssh -l jumpboxloginname -i ~/.ssh/private-key-to-jumpbox my.jumpbox.com -L 1111:my.rdp.server:3389, or,
If you have password-based login enabled, use
ssh -l jumpboxuser my.jumpbox.com -L 1111:my.rdp.server:3389 )

This opens an interactive terminal to the jumpbox and also opens a local SSH tunnel to the jumpbox. This ssh command instructs the Jumpbox to forward any traffic coming in from your localhost port 1111 (running Remmina) to the RDP host / windows machine.

Step 2: Use Remmina to connect to the RDP host via Jumpbox: Open the Connection Profile in the Remmina Gui. In Remmina, in the "Basic" Tab, enter localhost:1111 (and the credentials of the Windows User). In the "SSH Tunnel" tab, do not enter anything.

basic tab


Note that everything is greyed out here in the tab below. Note that "Enable SSH Tunnel is inactive (already taken care of in Step (1)).

ssh tunnel tab

Optional. (If you ran tmux or byobu) Hit F6 to detach (not disconnect) from the jumpbox. If you have Remmina still open, the terminal window appears to hang. Type CTRL-z . Type bg. to get your terminal back. The tunnel, however, stays open. - If you had closed Remmina before, both the terminal connection and the SSH tunnel will be closed. And you will get back your terminal immediately.


In Remmina's "Advanced" tab, it might also be necessary to set the TLS level selection box to 0 - Windows 7 compatible.

0

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:

  1. create the tunnel outside of remmina, and use remmina just for the RDP over that tunnel
  2. 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:

settings required on Basic tab for remmina 1.4

The tricky part for me was method 2:

  1. 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)
  2. Edit the entry
  3. On the Basic tab, change Server to the value of PRIVATE_RDP_IP:RDP_PORT, eg 10.0.0.1:3389
  4. 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:

enter image description here

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.

You must log in to answer this question.

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