Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using mac os 10.8.2, and connecting to a cloud computing cluster through Xquartz.

I do:

ssh -CY <uname>@serveradress
and then ./<softwaretoopen>

and it opens the software perfectly fine, but it is common that for some reason I loose the connection, and then when I try again I get the error:

ssh -CY <uname>@serveradress
and then ./<softwaretoopen>
Xlib: connection to "<servername>" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key

Then if I restart my computer and try again it's good again, but this is becoming extremely annoying since everytime I get disconnected have to close all open software, restart computer and try connecting again.

Any idea how to solve such issue?

Thanks in advance!

share|improve this question

migrated from Jan 26 '13 at 7:23

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

up vote 4 down vote accepted

I found the asnwer in link at the bottom of the page.

Basically what I have to do without restarting the computer is to:

rm ~/.Xauthority*

On the server, then close X11, then re-open X11 and connect to the server again.


share|improve this answer
JUst to update about it, it does not work all the time not sure why, if someone has more advice I'd be happy to hear about it, thanks! – Dnaiel Jan 28 '13 at 17:50
Yes rm ~/.Xauthority* works fine for me too. Just to add to above answer, the "server" refers to local machine, from which you want to view the GUI and client refers to the remote machine on which the UI process (e.g. eclipse, xclock) has to be started. – user1799846 Aug 19 '15 at 9:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .