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 ?

link|improve this question

67% accept rate
feedback

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

link|improve this answer
feedback

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.