Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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 ?
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.
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: