1

We have a small linux cluster ~12 computers and a similar number of users.

Is it possible for a superuser to launch a graphical application - say firefox or even a python script on another machine that is being used by another user?

moadeep
  • 184

3 Answers3

2

Actually what you want is a basic concept of the X window system. However, recent Linuxes don't allow remote X clients by default. You have to enable it first. The tool xhost can do that. Running xhost + simply disables access control and any client can interact with that server.

X server instances are addressed by <host>:<display>. To have a xterm you run on your machine render to a remote X server you would write DISPLAY=remotehost.my.doma.in:0 xterm or if you prefer using IP-addresses, you could write DISPLAY=192.168.0.1:0 xterm. :0 identifies the xserver uniquely within a host. Usually, display managers start xserver numbering at 0 so it's a relatively safe bet to assume the remote xserver is display 0. This example command will start an xterm on your machine as you (uid) but render to and get events from the remote xserver at 192.168.0.1, which means there is a xterm running as you on your machine, but it is used by somebody else on another machine.

Honoring the DISPLAY environment is part of Xlib and therefore supported by each and every X application.

Bananguin
  • 7,984
0

You could try this:

In the users autostart directory ~/.config/autostart keep a launcher to a minimal python script/ bash script that waits for a file in a particular directory. (use Inotify - it has a bash shell command that will block till a directory changes) It then executes the commands in the script. This will launch full gui apps that appear on the user's screen.

The alternative will be to extract the X cookies and the env variables from a root process- ewww.

staticd
  • 111
0

Yes, it's called X11 forwarding

ssh -X <user>@<localmachine-ip>
firefox

Of course it's never that easy, you need to copy the Magic Cookie and alter the config file /etc/ssh/sshd_config