Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

By transparently I mean forwarding of:

  • stdin, stdout and stderr
  • standard signals (SIGHUP or SIGINT would be great for a start)

As an example, consider these invocations of a (pointless) local and remote command:

$ `cat - > /dev/null; sleep 10` < /local/file
$ ssh user@host "cat - > /dev/null; sleep 10" < /local/file

I can interrupt the first one with ^C just fine. But if I try this during the second one it only affects ssh, leaving the command running on the remote server if cat has already finished.

I know about launching sshwith -t, but this way I can't send data via stdin. Is this possible with ssh alone at all?

share|improve this question

Signals are the domain of the local kernel; they are not ever carried across a network link.

While you can run commands in a remote ssh session from a local computer, that does not magically make the system-level events on the remote computer available locally.

You would have to wrap the entire thing in a script that traps all (possible) signals and communicates these back across the ssh connection, but even then they wouldn't magically become signals again.

Perhaps something involving nc would be more appropriate for shuffling std{in|out|err} across; that, too, is not part of ssh's toolset.

share|improve this answer
I have noticed that the ssh protocol supports sending of signals, and exit values. But the openssh only seems to support exit values. I expected to be able to send a signal to ssh for it to Marshall it across to the sshd that would then in turn signal the remote process. – richard Oct 24 '12 at 14:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.