[SOLVED] SSH: X11 forwarding request failed on channel 0
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,672
Rep:
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.
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.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,672
Original Poster
Rep:
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.
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)
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,672
Original Poster
Rep:
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.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,672
Original Poster
Rep:
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.
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.
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.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,672
Original Poster
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.