Don't disable ipv6... Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
Posts: 3
Joined: Sat Feb 06, 2016 6:26 am

Don't disable ipv6...

Post by memilanuk »

...if you want X11 Forwarding to work over ssh!

I spent hours trying to figure out why in the blue blazes I couldn't get X11 Forwarding to work. Normally, I never really cared - if I want CLI access, I use ssh. If I want GUI access, I use VNC or RDP. But for one reason or another, I thought "hey, it would be really neat if I could run just *one* remote linux gui app on my local desktop, rather than an entire remote desktop". So, I started working at this.

MobaXterm has this neat little feature during the initial connection where it gives you a formatted banner about some of the details of the ssh connection - X11 Forwarding, compression, etc. I'd noticed in the past that most of my devices showed X11 Forwarding as 'enabled', with a green check mark. Not all of them, though. Every once in a while, one showed 'disabled' with a red X. Again, I never really paid any attention to that, because well... I didn't use it. Now, though...

At first I thought it was a Raspberry Pi problem... then maybe a DietPi problem... then maybe a MobaXterm problem. Thing is, I saw *lots* of recommendations for MobaXterm for *exactly* this use - it comes with built-in Xwindows support, no need for another external program like with PuTTY / Xming. And I saw more than a few examples of people connecting with RPi's. Yes, I had 'X11 Forwarding' uncommented in /etc/ssh/sshd_config, and yes, it was toggled to 'yes', and yes, it was the sshd_config file, not the ssh_config file, and yes, I had xauth installed. WTF?!?

After giving up on reading yet another tutorial, because all they ever show is what happens when everything works *right*... I was wading thru page after page of search results on DDG. Finally stumbled across a thread on Unix StackExchange, which linked to a ten year old thread on that mentioned a bug in openssh: disabling ipv6 breaks X11 forwarding in ssh.

Part of me couldn't believe that this would possibly turn out to be the fix. Ten year old bug, and still silently breaking things? Naw...

Yep. During initial configuration of this particular RPi, I'd turned off ipv6 because hey, I don't need that crap for my home network! Turns out that was probably why I sometimes saw MobaXterm show X11 forwarding as 'disabled', and sometimes not, as I nuked and reloaded various configurations testing one thing or another.

Fired up dietpi-launcher, got into the dietpi-config tool and turned back *on* ipv6 networking, re-enabled 'prefer ipv4', saved and rebooted. Voila, I now had X11 forwarding!!! And yes, it works ;)
User avatar
Posts: 5115
Joined: Sat Nov 16, 2019 12:49 am

Re: Don't disable ipv6...

Post by Joulinar »

thx for sharing. good to keep that in mind.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Site Admin
Posts: 3097
Joined: Sat Nov 18, 2017 6:21 pm

Re: Don't disable ipv6...

Post by MichaIng »

The alternative is to start OpenSSH with the IPv4 flag, if I get it right?

Code: Select all

G_CONFIG_INJECT 'AddressFamily[[:blank:]]' 'AddressFamily inet' /etc/ssh/sshd_config
Post Reply