4

I'm running an ssh command as a background job:

ssh -l user server 'sleep 1000' &

Lets say that the above returns the process ID: [ssh_pid].

How can I make ssh forward signals to the remote process?

i.e. Supposing that I do: kill -TERM [ssh_pid], then it should forward the TERM signal to the remote process, instead of handling it by itself.

Kowshik
  • 1,541
  • 3
  • 17
  • 25

1 Answers1

2

A similar question is examined here: https://unix.stackexchange.com/questions/40023/get-ssh-to-forward-signals. There is no great solution. Using that answer, here's a suggestion that works for me:

ssh -tt -oLogLevel=quiet server 'stty raw isig; sleep 1000' < /dev/null &
Community
  • 1
  • 1
DS.
  • 22,632
  • 6
  • 47
  • 54