WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: X-Windows X11 forwarding request failed  (Read 2407 times)

Offline kmhill

  • Jr. Member
  • **
  • Posts: 64
X-Windows X11 forwarding request failed
« on: February 06, 2018, 10:07:21 PM »
Hello folks;

I've had good luck with a first RasPi-0W system that I've configured. I have an X-Window server running on a Win7 machine and am connecting using ssh. The issue is that to summarize my notes, I'm making a new second system. I have TC.tcz as well as openssh.tcz installed. When I start the second system I get the following. The -Y option is for forwarding X11 messages.

$ ssh -Y tc@192.168.137.2
tc@192.168.137.2's password:
X11 forwarding request failed on channel 0

While ssh is connecting, it's not able to do X11 forwarding. In digging about I'm seeing comments about xauth, a magic cookie in .Xauth, as well as xhost. Any and all comments will be appreciated.

Krista

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: X-Windows X11 forwarding request failed
« Reply #1 on: February 07, 2018, 09:48:03 AM »
Hi,
my  ~/.ssh/config  on the system I'm ssh'ing from looks like this:
Code: [Select]
Host pi3
   User tc
   HostName 192.168.0.3
   #ForwardX11 yes
   #ForwardX11Trusted yes
   XAuthLocation /usr/local/bin/xauth
   AddressFamily inet


When I need to forward X11 apps, I uncomment the respective two lines by removeing the hashes ("#").

Otherwise, Midnight Commander comes in very handy, too:
Code: [Select]
mc "$PWD" "sh://pi3/~"
« Last Edit: February 07, 2018, 09:49:52 AM by Misalf »
Download a copy and keep it handy: Core book ;)

Offline kmhill

  • Jr. Member
  • **
  • Posts: 64
Re: X-Windows X11 forwarding request failed
« Reply #2 on: February 07, 2018, 08:18:52 PM »
Hi Misalf;

Thanks for your note. In digging it looks to me that uncommenting those lines has the same effect as using the -Y option. I'm still trying...

Krista

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: X-Windows X11 forwarding request failed
« Reply #3 on: February 07, 2018, 08:58:37 PM »
I had to use those two line in order for the -Y option to work in the first place.
Download a copy and keep it handy: Core book ;)

Offline kmhill

  • Jr. Member
  • **
  • Posts: 64
Re: X-Windows X11 forwarding request failed
« Reply #4 on: February 07, 2018, 09:32:07 PM »
Okay, that's related to the machine you're connecting from.

In digging I found something else in TinyCore. The configuration file for sshd comes with X11 forwarding turned off. I had a vague memory of previously hand editing that file. This time I used nano to edit the configuration file.

$ sudo nano /usr/local/etc/ssh/sshd_config

In the file, next search for the text "X11Forwarding" and change that line and the next to look like the following:

X11Forwarding yes
X11DisplayOffset 10

With the edits made, to make it permanent you can insert the configuration file name to the end of /opt/.filetool.lst
but of course without the leading / . Next, reboot or otherwise restart/reload sshd

So far, so good.
Krista