LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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



Reply
 
Search this Thread
Old 05-18-2012, 08:48 AM   #1
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,563

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
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.
 
Old 05-19-2012, 05:13 AM   #2
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,146

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
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.
 
1 members found this post helpful.
Old 05-19-2012, 07:39 AM   #3
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,563

Original Poster
Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
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.
 
Old 05-19-2012, 07:56 AM   #4
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,146

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
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)
 
Old 05-19-2012, 08:06 AM   #5
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,563

Original Poster
Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
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.
 
Old 05-19-2012, 08:11 AM   #6
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,146

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
where did you execute xhost +?
 
Old 05-19-2012, 08:16 AM   #7
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,563

Original Poster
Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
Quote:
Originally Posted by pan64 View Post
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.
 
Old 05-19-2012, 08:19 AM   #8
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,146

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
can you check if the port is opened or the ssh channel is available? (so it is a problem with ssh or with X)
 
Old 05-19-2012, 08:21 AM   #9
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,563

Original Poster
Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
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.
 
Old 05-19-2012, 08:36 AM   #10
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,146

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
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.
 
Old 05-19-2012, 08:48 AM   #11
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,563

Original Poster
Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
When I run netstat I'm seeing this:
Code:
tcp        0      0 *:6010                  *:*                     LISTEN      5304/1
so I think the port's open.
 
Old 05-19-2012, 08:59 AM   #12
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,146

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
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.
 
Old 05-19-2012, 09:03 AM   #13
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,563

Original Poster
Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
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.
 
Old 05-19-2012, 09:27 AM   #14
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,146

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
Where did you the ssh command executed from?
 
Old 05-19-2012, 09:39 AM   #15
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,563

Original Poster
Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
I'm executing ssh on my netbook to connect to my PC.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] X11 forwarding failed doublealice Linux - Newbie 12 09-09-2014 02:12 AM
ssh -L '>channel 3: open failed: connect failed:' Luke771 Linux - Networking 14 01-24-2012 04:14 AM
[SOLVED] PTY allocation request failed on channel 0 sycamorex Slackware 1 01-30-2011 06:55 AM
PTY allocation request failed on channel 0 nice88 Linux - Server 4 12-14-2010 06:44 PM
x11 forwarding over ssh mantonr Linux - Software 1 07-15-2008 11:22 AM


All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration