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.
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
user@redhat_ip's password:
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Last login: Thu Mar 31 08:59:46 2011 from MAC_ip
Somebody also suggested to use 'ssh -Y', although I don't quite understand it, I also tried.
Code:
% DISPLAY=MAC_ip:0.0 ssh -Y user@redhat_ip xclock
user@redhat_ip's password:
connect MAC_ip port 6000: Connection refused
Error: Can't open display: localhost:10.0
This is really bother. Please advice. Thank you!
Last edited by doublealice; 03-31-2011 at 01:46 PM.
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:
I hope to see X of redhat on my own MAC
This will never happen (except perhaps using a remote desktop tool). What you probably mean is that you want the applications running on your remote Redhat host to use the X server running on your local Mac.
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:
If an xterm console appears on your local Mac, then X forwarding is working. The xterm is running on the Redhat host, but is displaying its output and receiving keyboard and pointer input from the X server running on your Mac. What's more, X11 is being securely tunneled through the ssh session, and no compromise of the server is required by using the likes of xhost.
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.
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!
Last edited by doublealice; 04-01-2011 at 11:31 AM.
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".
These messages say that the application expects certain optional functionality in the X server, and has failed to find it. The RandR extension allows the client application to query the server about some of its hardware capabilities, and is not universally supported. Evidently, there is also some issue with support combined with Xinerama. I don't know of any sure-fire remedy, especially since there is a driver-specific aspect to this matter. Does the same version of firefox running on the local host exhibit the same complaint? Firefox is a bit of a rascal when run on a remote host, as it will try to piggy-back onto an existing instance that is running on the X server host, unless started with the -no-remote option. Perhaps there is some interplay there.
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!
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.
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?
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.
Last edited by chuck_theobald; 06-06-2012 at 12:03 PM.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.