By transparently I mean forwarding of:
stdin
,stdout
andstderr
- standard signals (
SIGHUP
orSIGINT
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 ssh
with -t
, but this way I can't send data via stdin
. Is this possible with ssh
alone at all?
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.