Is there a way to tell SSH that the remote task should be killed once
the client disconnects?

For example, I tried running:

me@local$ ssh remote sleep 100

And then typed [Ctrl+C] to kill the ssh command on local. But the
sleep command kept running on remote for the full 100 seconds. I
think I want to be able to tell the remote machine, "if I interrupt
the ssh client, then kill the process I sent you."

Maybe I should be doing something else. I'm working on a script that
uses SSH to send some commands to remote machines, but sometimes these
commands can get into infinite loops and need to be killed. When this
happens, I'd like to be able to have my program kill them. It seemed
most straightforward to kill the ssh client, but then I discovered
this does not kill the remote process.



Jared C. Davis
3600 Greystone Drive #604
Austin, TX 78731