Ssh – Loading GUI on host machine through SSH with X11 forwarding

forwardingsshx11

I've got applications on my host machine running fine by doing:

$ssh -X user@host
Welcome to host
$firefox

Firefox proceeds to run in client display from the host machine.

How do I get firefox to load on the host machine's display so I could remotely manage the host machine's running GUI applications? I need my application to load a GUI on a remote machine without walking to that machine or expecting the user to launch it.

EDIT: Firefox is just an example app, but I am using one machine to launch several trainer programs on remote machines. Each remote machine will be controlled by a different person.

Best Answer

[This is really a superuser.com question, since there's no programming involved.]

The -X flag to ssh is specifically for sending the display back to the machine you ssh'ed from. To display on the machine you're ssh'ed to, instead you'd set the DISPLAY environment variable to that machines display (probably ":0" but may vary depending on configuration, virtual terminals, etc.), and make sure you have the right authentication set up to talk to that display (see the Xsecurity man page for details).