$HOST$ variable returning wrong value?

$HOST$ variable returning wrong value?

avatar

Hey all.

I am trying to set my RDM up so that I can have a single SSH Tunnel session, and then all my other RDP/SSH sessions will tunnel through tha via local port forwarding.
I thought I'd figured it out, but I've noticed something strange and I'm not sure if it's intended behaviour or if I'm doing something wrong. I'll do my best to explain as clearly as I can.

I have set up an 'SSH Tunnel' session as follows (just relevant settings with redacted values):

-- Take note of the variable, as that's the important point in this issue..

Name: My SSH Box (this is a Windows box running OpenSSH)
SSH Server Settings:
Host: jumpbox.somedomain.com
Local Tunnel Settings:
Mode: Local
Local address: 127.0.0.1
Local port: Default
Remote host: $HOST$
Remote port: Default


I then have an RDP session as follows:
RDP:
Host: server1.somedomain.com
VPN/SSH/Gateway:
General:
Type: Existing - SSH
Open: Always connect
Close: On session close
Settings:
Session: My SSH Box
Use dynamic port
Force "localhost": Yes


So I would expect that upon launching the RDP session, the following would happen..

  1. Start an SSH session to jumpbox.somedomain.com with Local Port forwarding of '56789:server1.somedomain.com:3389'. With that hostname being pulled via the variable from the RDP session
  2. Start RDP to localhost:56789.


However, it looks like the $HOST$ variable is not picking up the value I'd expect it to..

RDP is indeed connecting to localhost:56789, so the port forward part is working, but I'm actually ending up in an RDP session on jumpbox instead of server1. So $HOST$ is returning the value of the host from the SSH Tunnel session (itself), NOT the RDP Session.

Am I doing something wrong? I'd greatly appreciate any advice!

Thanks
FG

All Comments (3)

avatar

Hi fgwg,

This is normal. The $HOST$ variable gets the host of the current entry (this could be used in the description, or even as the name of the entry).

To do what you want to do, you would need to use the "Use over secure gateway" feature.

To do so, you'd need first to configure your SSH Tunnel to use the dynamic mode:



Then, you'd want to enable the "Use over secure gateway" option in your RDP session -> VPN/SSH/Gateway -> Settings pane:




Please, do tell me if this is not clear or if it doesn't work as expected.

Best regards,

Xavier Fortin

RDPVPNSettings.png

RDPVPNGeneral.png

SSHTunnel.png

avatar

Hi Xavier.

Thank you so much for explaining. I have tried this and it works exactly as you described.

Hugely appreciate your assistance and rapid response :)

FG

avatar

Glad to hear it!

Do not hesitate if you have any other issues.

Best regards,

Xavier Fortin