Score:1

X11 forwarding through a jump box

cy flag

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

Saïmonn avatar
in flag
Can you re-enable `ForwardX11` in your config and post some logs (`ssh -vv`) ?
Score:0
cy flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.