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
The -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 xhost +localhost
.
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)
xhost +localhost
would allow any local user to connect to the X server. It only works if the X server accepts TCP connections, which is often not the case nowadays. – Gilles 'SO- stop being evil' Oct 03 '12 at 22:45