Running applications remotely [closed]

Is it possible to use ssh to start applications remotely? I have a linux machine for a mediacenter and I want to be able to connect through ssh and start for example XBMC or Boxee on it and then use my iphone as a remote.


Sure:

$ DISPLAY=:0 /usr/bin/xbmc

(after you ssh into the machine of course)


I took a different slant on what the OP asked and now realise I might have gone in the wrong direction. Had written the full answer below before I realised this, and think some people might find this looking for the other interpretation.

The advice below is if you want to start the application remotely but view it locally (i.e. run on mediacenter, view on another PC).

You could use:

ssh -X user@server

/usr/bin/xmbc

The -X just means "use X11 Forwarding".

To get it all in one line you could just do:

ssh -X user@server "/user/bin/xmbc"

This will only work if the server (in this case your mediacenter) has the X11 forwarding option enabled (normally in /etc/ssh/sshd_config and the option is X11Forwarding yes - restart ssh after you change this - /etc/init.d/ssh restart)

Now, if you're really wanting ease of use, you could key share between the two computers and then make an icon on your desktop that ran the above command and you'd have passwordless access to it!