Is possible (by root
of course) to run a command from console, that will be executed on X-session owned by another user on the same linux box/machine ? Example: Can root
open xclock
for another local user logged into X11 ?
2 Answers
if the use haven'T protected his X session, it should be possible for any user on any network that X is listening to use the X server.
DISPLAY=$host:$displayNum xclock
You would need to set the DISPLAY environment variable to that user's X display, or invoke the command with a -display DISPLAYNAME
argument.
You may also need to ask the other user to grant you permission to use their display using the xhost
command:
xhost +yourname
or
xhost +yourhost