When trying to connect via ssh to a CentOS 6 server to invoke a GTK+ application, I received this message.
$ ssh root@192.168.200.233 -X
root@192.168.200.233's password:
X11 forwarding request failed on channel 0
Last login: Thu Apr 12 08:15:43 2012 from 192.168.201.151
After double check on my client Arch linux the /etc/ssh/ssh_config
file and corroborate that “ForwardX11 yes” was uncommented, began to search the web for a bug in CentOS’s openssh.
Firsts impressions and answers said that it was my openssh client’s fault… then I installed putty, enabled X11 Forwarding and tried again. Now it connected without saying nothing but when I tried to open the graphical application, it said this
# system-config-lvm
Unable to initialize graphical environment. Most likely cause of failure is that the tool was not run using a graphical environment. Please either start your graphical user interface or set your DISPLAY variable. Caught exception: could not open display
So it wasn’t openssh’s fault as someone said. Doing a bit more of research gave me the correct answer. Finally I found a bug on CentOS 5 bugzilla where is explained in detail.
My problem was that xorg-x11-xauth
wasn’t installed on my system (I did a minimal instalation). By installing xorg-x11-xauth and rebooting the server (until I did, it did not work), it connects without problems by typing
$ ssh root@IP_ADDRESS -Y
I tried with the -X parameter instead -Y, but it gave me some problems. With -Y it works like a charm!
you forgot the ‘x’ in xauth
xorg-x11-xauth : X.Org X11 X authority utilities
typo modified!
Thank you!
Thanks, This fixed my issue on Rhel 6 u 3 box
Thanks, this helped a lot.
Thanks, excellent pointer.
Solved my problem by adding “AddressFamily inet” to the VM’s /etc/ssh/sshd_config
Another potential solution (aside from the obvious ‘X11Forwarding yes’ sshd option) is to make sure XAuthLocation is correct. (Check with: `strings /usr/sbin/sshd |grep xauth` and `rpm -ql xorg-x11-xauth | grep bin/xauth`)
Reference: http://bugs.centos.org/view.php?id=2391
Hi @TrinitronX,
What OS are you using as client? Ubuntu perhaps?
That “AddressFamily” workaround sound to me to a issue with ubuntu.
Isn’t it the other potential solution you mentioned, to corroborate you have xauth installed in your system?
Regards
my problem got solved by setting X11Forwaring to YES in /etc/ssh/sshd_config and restarting sshd.
I am using ArchLinux.
Thanks!
+1 CentOS 6.N. No reboot required for me.