1

I have a machine that is configured to auto connect to a jump/bastion box when there is an internet connection. I configured its ssh config file as follows:

Host tunnel
        HostName <jump machine ip>
        IdentityFile <path to file>
        User <user>
        RemoteForward 5900 localhost:5900
        RemoteForward 9933 localhost:22

From my local machine (WSL2 Ubuntu) I can then ssh thru the jump box and gain access to the first machine via a ProxyCommand:

Host home
        Hostname localhost
        Port 9933
        User <user>
        IdentityFile  <path to file>
        ProxyCommand ssh jump -W %h:%P
        LocalForward 5901 localhost:5900

The way I have it configured now I can easily access this machine via VNC but I really want to use X11 forwarding instead. I have tried to configure X11 but failed each time. I am looking for info from people that have configured this and how they accomplished this. I have tried to add ForwardX11 to my config file(s), enabled it in the sshd_config file(s), disabled/re-enabled use local host, etc etc.

Any help is greatly appreciated! Thank you in advance

inzel
  • 11
  • 2

1 Answers1

0

Turns out the entire problem was because my WSL2 Ubuntu machine did not have a DISPLAY variable set before attempting to connect via ssh. After running:

export DISPLAY=localhost:0.0

I was then able to connect via ssh with X11 Forwarding.

inzel
  • 11
  • 2