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).
-i