Sending Signal to remote process

Dale Worley dale.worley at oracle.com
Thu Jan 25 02:39:34 AEDT 2018


>> I want ssh to forward the SIGTERM signal to the remote command.
>>
>>
>> Example:
>>    ssh root at localhost /root/print-signal.py
>>
>>
>> Get PID of ssh:
>>     ps aux| grep print-signal
>>
>>
>> Kill the matching ssh process:
>>     kill pid-of-ssh
>>
>>
>> Unfortunately only the ssh process itself gets the signal, not the remote
>> command (print-signal.py). The remote command does not terminate :-(

Depending on your exact use case, this might help:  Have an option to 
ssh that causes it to print the PID of the user process on the remote 
computer.

Dale



More information about the openssh-unix-dev mailing list