I have a user A that need to log into a linux box, change to user B, and then fire up a GUI.
I've tried this:
[userA@server ~]$ sudo su - userB -c "xterm"
X connection to localhost:10.0 broken (explicit kill or server shutdown).
Running "echo $DISPLAY" shows the same value for user A as for user B when I first run "sudo su - userB".
I thought that if the $DISPLAY variable is set correctly this would work, but apparently it doesn't. Does anyone else here know how to get this working?
EDIT: I forgot to mention that I'm SSH-ing into the server, and have x-forwading enabled.