How to stop program of non-interactive SSH call without pseudo-terminal
2
votes
1
answer
401
views
Let's say I start a program with a non-interactive SSH call (without pseudo-terminal) and exit the session via CTRLC:
$ ssh user@server -- sleep 123
^C
This way, the program, in this case
sleep 123
for example, is still running on server
, even after the SSH session was terminated:
$ ssh user@server -- ps -ef | grep "sleep 123"
user 12430 1 0 19:28 ? 00:00:00 sleep 123
I am aware of ssh
's -t
option to have SIGINT sent to the remote sleep
instead of the local ssh
. But I'm looking for a way to make the remote program stop without having to resort to a pseudo-terminal and specify extra options in the ssh
call.
Asked by finefoot
(3554 rep)
Jan 18, 2023, 07:22 PM
Last activity: Jan 18, 2023, 10:18 PM
Last activity: Jan 18, 2023, 10:18 PM