Invalid MIT-MAGIC-COOKIE-1 key

Recently I couldn’t start the x server and I got a mysterious Invalid MIT-MAGIC-COOKIE-1 key error. I deleted the .Xauthority files in my home directory which fixed my problem.

rm ~/.Xauthority*


  1. Alex

    Thank you! That’s great note :-)

  2. slopjong

    I just share my experiences no matter if they’re useful for others or not. In this case it’s been useful :-D

  3. nd


  4. Luis

    Ty so much!

  5. Jon

    Just moved my /home to a new HDrive/partition and got this error. Saved me a ton of work – thanks!

  6. Sumit

    Don’t ever try this…I tried this…now getting a new error, “No protocol specified”..

  7. slopjong

    Don’t beleive @Sumit, he doesn’t know what he does :D


    man xauth

    you’ll find out how to recreate .Xauthority and how to add the cookie.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>