I rarely use GUIs, but when I do, it’s from CLI and every time I run into the annoying MIT-MAGIC-COOKIE-1 data did not match error. It’s easy to fix, but it happens to me so rarely that between the fixes I forget how I did it.

So here’s a bash one-liner – sort of – to be ran after you sudo to whatever other user account. This works best for the root account as it relies on the target user to have passwordless sudo access to the source user’s .Xauthority file.

You can add it as a convenient alias in your .bashrc if this is something you plan on running often.

Leave A Reply

Please enter your comment!
Please enter your name here