I want to execute a script, start.sh
on a remote server which runs this:
nohup node server.js &
Naively, I call SSH like this:
ssh myserver <<EOF
./start.sh &
EOF
This starts the script, but leaves the session connected. I want to follow this step with other commands in a script, so that's no good.
How can I SSH to the remote machine, launch a nohup
command into the background, then disconnect? I suppose I could put the SSH process itself into the background, but that doesn't seem right.