X11 forwarding failed
I had found many posts which talked about this problem. I also had ever tried all methods they mentioned, but my problem is still there. I write it down here and hope to get your help. Thank you!
I am using a MAC OS X 10.6 ssh a remote redhat server. I hope to see X of redhat on my own MAC. Below is what I've done: 'MAC_ip' stands for my mac; 'redhat_ip' stands for redhat server. 1) ssh to redhat server 2) change to root 3) type command: DISPLAY=MAC_ip:0.0 4) type command: export 5) Back to MAC 6) change to root 7) type command: xhost +Redhat_ip 8) vim /etc/ssh_config, add X11Forwarding yes 9) Back to redhat, type: xclock I got below message: Error: Can't open display: MAC_ip:0.0 I also tried some methods to login as others suggested: Code:
% ssh -X user@redhat_ip Code:
% DISPLAY=MAC_ip:0.0 ssh -Y user@redhat_ip xclock |
On the Red Hat machine before you use ssh enter the following command.
Code:
xhost +inet:MAC_ip |
I tried: xhost +inet:MAC_ip, but it said:
xhost: unable to open display "" The redhad server is a brand new server. I can use ssh login it. Does it mean the firewall on that server approves my connection? |
It's been a while but I'm sure that X11 forwarding has to be enabled in the redhat machine.
/etc/ssh2/sshd2_config AllowX11Forwarding yes |
This may seem like a dumb qn, but many servers don't have X-win installed. Are you sure the RH server does have X-Win installed?
|
doublealice, you are yet another among the legions of people confused about the X11 client-server model. Don't be insulted, it fools almost everyone as they first approach it.
Quote:
To do so is relatively easy. First, do as themanwhowas suggests, and make sure X11 forwarding is enabled on the Redhat host. Next, from the commandline on your Mac, with X11 running on the Mac: Code:
ssh -X someuser@your.redhat.host As chrism01 correctly points out, there may be no X11 server on the Redhat server. This is absolutely no obstacle, and is a very common model for management of headless file and database servers. --- rod. |
Hi Rod and all,
Thank you so much for your help. I tried what you've suggested. It works! I am so happy for that. But there is still some warnings. What I've done as below: My redhat is a new server running redhat enterprise server 6. There isn't ssh2_config file. So like what I did yesterday, I uncommented a line contains 'X11Forwarding yes' in sshd_conf. Back to Mac, in terminal, type 'xterm&'. In a X terminal, using ssh login to redhad, as Rod suggested. I can login but got two warnings: Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. Although I got those warnings, I still typed xterm& and opened a new xterm which comes from redhat. Then try 'xclock&'. It displayed!! So great! Now, I have an other question. I opened 'firefox' from xterm. Firefox was also booted up, but the letters on menu and top bar were blurred. And the warnings I got were: Xlib: extension "RANDR" missing on display "localhost:10.0". Xlib: extension "RANDR" missing on display "localhost:10.0". Xlib: extension "RANDR" missing on display "localhost:10.0". Have you ever met such problem? This is a new problem. But I already feel so happy that you help me solved a problem which had bothered me for more than three days! Thanks all your help! |
Did you undo all of the xhost/xauth configuration that you originally tried? My interpretation of the error/warning messages is that they originate there.
Code:
Xlib: extension "RANDR" missing on display "localhost:10.0". --- rod. |
Rod, I am new to a linux server. Thank you so much for explaining the problem to me. The reason I started up the firefox from the remote server was I needed to check if apache server worked on localhost well or not. Probably it is not a good way to do so. Anyway, I've learned a lot from you and may keep asking questions in the future. Thanks!
|
X running under OSX
I am running Ubuntu 10.04
Using "New Remote Connection" under terminal I add my target hostname and then type ssh -2 -X username@hostname Enter my password xclock etc all work now, but importantly when I type in the terminal gnome-session Up pops an Ubuntu Desktop on my iMAC. But whilst it works there are still a torrent of RANDR errors in the terminal. Any suggestions on what I need to suppress these. jnt |
Is the RandR extension builtinto the iMAC X server? If not, then the messages are likely to keep appearing. It may also be (speculation only here) that you are trying to get the X server to do something which is in conflict with a setting imposed by the iMAC desktop. Do those errors happen when you run any old X application, or only when you try to run a desktop on another desktop?
--- rod. |
RHEL does not automatically come with xorg-x11-xauth installed. This must be installed for X11 forwarding to work:
yum install xorg-x11-xauth Discovered this using the -v option to ssh, making it verbose. |
Worked!
Thank you chuck_theobald. The missing package on RHEL was what fixed this for me. I realize this thread is older, but for anyone else out there trying to tunnel X through multiple hops and hissing "Cannot open display" on a RHEL Client 2 or 3 hops away it's easy to get bogged down in the intricacies of SSH forwarding, when actually, it might just be this missing package. After I'd added the xorg-x11-xauth package I was able to simply ssh -Y <hop1>, then ssh -Y <hop2> and run the app, with the display coming back to my laptop perfectly.
|
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
I know this is an old thread, but it showed up when I had this same problem.
Environment: XQuartz 2.7.11, macOS 10.4 Mojave. Error: ssh -x hostname produces Warning: untrusted X11 forwarding setup failed: xauth key data not generated Solution: ssh is looking for xauth in /usr/X11R6/bin and on macOS with XQuartz it is in /opt/X11/bin. Edit ~/.ssh/config to define the correct XAuthLocation and X11 forwarding now works. Code:
Host * |
All times are GMT -5. The time now is 07:09 AM. |