If you have either myuser's password or a key in myuser's ~/.ssh/authorized_keys, and your system doesn't support the
xhost +si:localuser syntax, you could try
ssh -X myuser@localhost xterm
-X enables X forwarding over that ssh connection, creating a new virtual X server, only accessible to that other user, that forwards requests to your X server without opening it up to any process run by any user on the system which is what usually happens when
xhost meets urgent-need or laziness or ICBFRTFM resulting in
That method also works (and shows its full potential) when the user is on a remote machine.
There's some overhead in forwarding X over ssh like this, but unless you're running something intensively graphical (like a 3D game), you're not likely to notice any performance drop. Adding the
-o Ciphers=arcfour option to ssh may improve performance.
(BTW, I have run 3D programs like second-life clients over an
ssh -X connection like this, connecting to another machine on my home LAN. it's not great, but it works well enough for testing purposes)