let's say I have a really-long-running.sh ("really long" as in "hours").
I should like to have a remote machine execute it (and then shut down the local machine).
Unfortunately, I don't have much experience with ssh. Does this do what I want it to do or does it just mask the connection?
ssh user@host "bash -s " < really-long-running.sh &
UPDATE
It doesn't.
How then can I do this?
ssh user@host "bash -s " < really-long-running.sh &feedsbashrunning on the remote side with commands from local.shfile throughsshwhich runs locally in background. I think even if you make remotebashsurvive your disconnection, it will stop reading the script whensshcloses (when you shut down the local machine). Your script should be there on the remote side so the remotebashcan read it when you disconnect. It's not enough to makebashsurvive your disconnection though – you still have to pick one of the solutions from the answers. – Kamil Maciorowski Oct 12 '16 at 16:51