LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   SSH: X11 forwarding request failed on channel 0 (https://www.linuxquestions.org/questions/linux-software-2/ssh-x11-forwarding-request-failed-on-channel-0-a-945709/)

273 05-18-2012 07:48 AM

SSH: X11 forwarding request failed on channel 0
 
I have a PC with SSH server installed and often connect to it from my netbook (both running Sid) with X forwarding enabled. Since the other day when I connect to the PC I receive the message "X11 forwarding request failed on channel 0" and X forwarding no longer works.
On the host Pc I see the following in auth.log:
Code:

sshd[3786]: error: Failed to allocate internet-domain X11 display socket.
I read around and saw mention that adding "AddressFamily inet" to sshd_conf solved this for some people but I still have the same problem after adding it.
I also tried running "xhost +" from the host PC but this has had no effect either.
I recall I struggled to set up X forwarding in the first place as I'm not at all familiar with setting it up so if anyone has any suggestions of anything else I could try I would be very grateful.

pan64 05-19-2012 04:13 AM

I found this:
it is a known bug from openssh. You can prove and see the reason, when you start sshd in debug modus: it tries to open several hundreds unix-sockets till it reaches a limit.
and also I found the following tips here: http://dbaspot.com/solaris/397531-s1...g-problem.html
disable ipv6 in general
add AddressFamily inet" to sshd_config
add "X11UseLocalhost no" to sshd_config
set IPv4 explicitly in sshd_config
and also found this comment: "if on the remote host I touch hostname6.lo0 I get the remote display."

I know that is and old solaris thread, but maybe you can try some of them (if not yet done). I'm really interested if it was a such an old bug in openssh.

273 05-19-2012 06:39 AM

Thanks, adding "X11UseLocalhost no" seems to work (I don't see the error) but when trying to open an application I receive the error "Error: Can't open display: netbook:10.0" and the application doesn't open. I tried the -4 option on the client too but that doesn't change anything.
I don't know how to set the IP6 options mentioned.
I do wonder if this is possibly an X permissions issue and there's something simple I'm missing.

pan64 05-19-2012 06:56 AM

The can't open display message is a good news I think. The connection is ok, you have an authentication problem. Maybe the sshd is run by root and it has no right to access your display (or something similar)

273 05-19-2012 07:06 AM

My apologies, the error was "Error: Can't open display: PC:10.0". I tried running "xhost +" after the error and reconnecting but I still receive the same error.

pan64 05-19-2012 07:11 AM

where did you execute xhost +?

273 05-19-2012 07:16 AM

Quote:

Originally Posted by pan64 (Post 4682574)
where did you execute xhost +?

On the PC (the server) initially but now I've executed it on both and with the same error (Error: Can't open display: PC:10.0) as a result.

pan64 05-19-2012 07:19 AM

can you check if the port is opened or the ssh channel is available? (so it is a problem with ssh or with X)

273 05-19-2012 07:21 AM

I'm not sure what you mean? I can SSH into the PC fine, it's just X forwarding that's failing. I've no firewall or anything installed on the PC or netbook and X forwarding works the other way.

pan64 05-19-2012 07:36 AM

usually X server opens a port for every display.
:0 will be listening on 6000, :1 on 6001, .... :10 on 6010.
So when you create X forwarding ssh will open the port 6010 on your PC and forwards to port 6000 on your laptop.

273 05-19-2012 07:48 AM

When I run netstat I'm seeing this:
Code:

tcp        0      0 *:6010                  *:*                    LISTEN      5304/1
so I think the port's open.

pan64 05-19-2012 07:59 AM

that is fine, so it means it should be an x authentication or security problem. Try ssh -X and ssh -Y, see the man page of ssh, maybe you will find it.

273 05-19-2012 08:03 AM

I've tried both X and Y options to the same effect. My problem is I have no idea how to solve an X authentication issue "xhost +" is about as much as I know how to do.

pan64 05-19-2012 08:27 AM

Where did you the ssh command executed from?

273 05-19-2012 08:39 AM

I'm executing ssh on my netbook to connect to my PC.


All times are GMT -5. The time now is 07:52 PM.