Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

No matter how much you want to escape running graphical applications on a remote Linux server there are times (like when configuring Oracle WebLogic domains for example) that you are forced to do so. Sometimes, the user you have to be running these applications as is not the same as the your login user, this leads to errors like this...
 Error
X11 connection rejected because of wrong authentication.
Error: Can't open display: localhost:10.0


Ooops! This is easy to resolve though.

Before continuing, make sure you are running ssh with the -X switch (and that you have an X11 server running on your machine). Now after logging in as your initial user, do this:
 Terminal
xauth list


That will give you some output similar to this...
 Terminal
myhost.mydomain.com/unix:10 MIT-MAGIC-COOKIE-1 1183c75928e9dc95378aa3172b142652


Take note of the above and change to the user you need to run the graphical app as...
 Terminal
sudo su - appuser




Now you need to run xauth again, but this time not using 'list' but 'add' and after the 'add' command you provide the info that the 'list' command gave you above, like so...
 Terminal
xauth add myhost.mydomain.com/unix:10 MIT-MAGIC-COOKIE-1 1183c75928e9dc95378aa3172b142652


Then if everything went right, you can run your graphical app (xclock in the screenshot below).
xclock.png


-i

Please leave your comments or feedback below!
comments powered by Disqus
Other posts you may like...
Hi! You can search my blog here ⤵
Or browse the recent top tags...

Recent Blog Posts

Mini review of the Sonoff B1 WiFi light bulb

Coherence cache performance optimistic vs replicated schemes

Coherence and weblogic.xml in different types of J2EE web app deployments

Atari Lynx repair - Part 5 - McWill LED screen mod installation

Atari Lynx repair - Part 4 - screen cover replacement

Atari Lynx repair - Part 3 - broken speaker replacement

Atari Lynx repair - Part 2 - re-capping the motherboard

Atari Lynx repair - Part 1 - introduction and case disassembly

jPhotoFrame updated to version 0.3.1 with an image rotation correction utility

iOS 11 pre-GM mini review before it gets revealed next week

Recent Galleries

Atari Lynx repair - Part 5 - McWill LED screen mod installation

Atari Lynx repair - Part 4 - screen cover replacement

Atari Lynx repair - Part 2 - re-capping the motherboard

Atari Lynx repair - Part 3 - broken speaker replacement

Atari Lynx repair - Part 1 - introduction and case disassembly

Building a custom Atari Lynx game box storage shelf unit in a day

Protecting old Atari Lynx game boxes with snug fit plastic sleeves

Monument Valley 2 is released and does not disappoint

Space Food - Chocolate Ice Cream with Chocolate Chips

Legeod Star Wars AT-DP kit

Blogs and Friends

Matt Moores Blog
Georgi's FlatPress Guide
Perplexing Permutations
The Security Sleuth
Ilia Rogatchevski
Travelling Fairy

Blog Activity

Blog Activity