Convert X2GO config using proxy server to ssh config file

287 views Asked by At

I would like to convert my X2GO connection config to a more usual ssh config file in order to use the VS Code in remote mode. But with this proxy server, I'm really lost.

Here is my X2GO configuration setup.

Here is my attempt:

Host domain
Hostname H
User login
Compression yes

# Automatic connection to hosts behind a firewall
Host *.domain
ProxyCommand ssh domain "nc `basename %h"
User login
Compression yes
1

There are 1 answers

0
Simon T. On

It's somewhat late, but maybe it is helpful for someone.

I have a similar question posted here.

For me, the solution is to use an SSH tunnel as described here and here.

The summary is, first setup your ssh config file:

Host remote* # if you have several host with a similar pattern
    HostName %h.full.qualified.domain
    ProxyJump my.proxy
    User <user_name>

Host my.proxy
    Hostname proxy.full.qualified.domain
    User <user_name>

Then, open an SSH tunnel in PowerShell like this:

ssh -L 2222:localhost:22 <targe_remote_machine>

Important, the PowerShell window with this tunnel connection needs to stay open. In the X2Go session setting, we then just have to give "localhost" as the host and "2222" as the port.