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.
-t
in the commandline by configuringRequestTTY
inssh_config
. Or you can use a shell function or script file to shadowssh
and add/alter options as desired.ssh
with separate stdin, stdout, stderr AND tty.