[SOLVED] X11 forwarding request failed on channel 0
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Hello,
I have RHEL 6.3 container. I am trying to run xclock from MobaXterm and it is not successful. At the time login itself, it give me error, which I mentioned in subject line
Code:
[465376.L9701067] ➤ ssh -X root@linux_123
X11 forwarding request failed on channel 0
Last login: Wed Apr 30 20:16:11 2014 from 10.24.46.23
[root@linux_123 ~]# xclock
Error: Can't open display:
[root@linux_123 ~]# echo $DISPLAY
[root@linux_123 ~]# cat /etc/ssh/sshd_config | grep X11 | grep -v "#"
X11Forwarding yes
X11UseLocalhost no
[root@linux_123 ~]#
If you have a DISPLAY environment variable defined then it should be forwarding.
Of course, if you still have it being defined in the profile, you can't tell - it may be forwarding, but you are getting the wrong DISPLAY value with the wrong key - thus it would still fail.
To me, it looks an issue of wrong DISPLAY setting. In simple words, your local machine don't know where to open/launch the x utility. However, try to set DISPLAY variable as (use port no. 0.0):
I am able to fix it.
I created .Xauthority file manually. Apart from this, ssh daemon was not able to restart properly. When I did reload and restart, still few old processes were holding it. I killed all ssh processes and then it worked.
Thanks Shivaa and jpollard
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.