I want to start a shell script that resides on a remote machine. When I usessh user@example.com /path/to/script.shit needs the ssh connection to be open until the script has terminated.But I need the script to continue to run, even after I close the ssh connection until the script finishes by itself. I just want to start a process and then forget about it.How can I do this using ssh?Thanks a lot!P.S.: This is not a duplicate of this stackechange question. 
How can I start a remote process on a remote machine via ssh?
bash;shell;ssh;scripting
I believe the problem is that when the SSH session is closed (by hitting ctrl-c, or closing the xterm), a HUP is sent to the process. To fork the process to background, add &, and to block the hup, use nohup:ssh user@example.com 'nohup sleep 300 >/dev/null 2>/dev/null </dev/null &'The ssh should start and the process will run on example.com in the background.If you wish to monitor its progress, you can use screen, if you wish to do that then something similar to this will help:ssh user@example.com -t 'screen -D -RR -S this /bin/sleep 300'This creates a screen session named 'this' (-S), detaches an already running screen if attached elsewhere and reattaches here. Then starts /bin/sleep with a 5min wait.