Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I logged into a Linux server (RHEL) from an linux desktop. There is not any error message at login, but I failed to launch firefox and see the following error emessage:

[myname@myserver ~]$ firefox &
[1] 8806
[myname@myserver ~]$ X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
The application 'firefox' lost its connection to the display localhost:11.0;
most likely the X server was shut down or you killed/destroyed
the application.

I tried to run the following command

[myname@myserver ~]$ xhost +

but get the following error message:

X11 connection rejected because of wrong authentication.
X connection to localhost:11.0 broken (explicit kill or server shutdown).

I also tried to run

[myname@myserver ~]$ echo $DISPLAY

and got the following result

localhost:11.0

I tried to search this problem from SO but I had no luck. What is the problem and how can I make the firefox work? It seems that the X window cannot be opened.

share|improve this question

migrated from stackoverflow.com Mar 4 '12 at 10:08

This question came from our site for professional and enthusiast programmers.

    
Has the machines ssh-keys been regenerated after you first connected there? Then you should get a warning message when you connect with ssh from ssh (something along man in the middle warning - host key has changed). –  Nils Mar 4 '12 at 20:37
add comment

1 Answer 1

Do not use xhost +. That opens up all sorts of doors and traps.

The best way is to let ssh deal with all of this, so do something like this on your local machine

$ ssh -X remote.machine.net

and once over there, test with a quick

$ xlock &
$ xterm &

which should pop up on your local box. Large apps like firefox take a lot longer.

share|improve this answer
1  
Thank you for your comment, but this actually does not work. I logged in using ssh -X -l myname remote.machine.net, but neither xclock nor xterm worked. The error messages are: X11 connection rejected because of wrong authentication. X connection to localhost:10.0 broken (explicit kill or server shutdown). –  fanchyna Mar 4 '12 at 3:44
1  
In that case you need to check your ssh configuration. X11 forwarding my be turned off. –  Dirk Eddelbuettel Mar 4 '12 at 4:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.