Running command transparently over ssh

Posted by jnsg on Server Fault See other posts from Server Fault or by jnsg
Published on 2012-06-28T01:33:31Z Indexed on 2012/06/28 3:17 UTC
Read the original article Hit count: 412

Filed under:
|
|

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?

© Server Fault or respective owner

Related posts about ssh

Related posts about pipe