SSH – Running Programs Over SSH

remote desktopssh

I am planning to log in to my college PC using ssh and run some simulations. These simulations take very long time, so I would like the relevant process to run longer than the ssh session (I want to log in, run the process, log out and collect the results the next day).

How can I do it

  1. If the process is a command line tool that doesn't expect any inputs (so that I just need the resulting output file)?
  2. If the process is a GUI, which sadly doesn't save the results to a file, but displays it instead. So in this case I was thinking of using ssh -X ... command, but then I don't know how to reconnect to the open window.

Best Answer

Assuming your college's computer runs all the time:

  1. Use GNU Screen or tmux and live happily ever after.
  2. Apparently, xpra offers that, i.e. it attempts to be "Screen for X11". (I've never used it, though.)

(There're other solutions for (1.), e.g. nohup and IO redirection, but Screen probably is the canonical tool for these kinds of issues. (You can then just re-attach to the detached session and see if the simulation still runs etc...))

Related Question