How to send three data channels via ssh?

I have a bash script on a remote host that produces a large amount of data on fd = 3, as well as some possibly interesting data about stdout and stderr. I want to:

  • Write stdout and stderr to a file on my local machine.
  • Enter the data on fd = 3 into stdout on my local machine.

Here's how to do it if my big script was local:


exec 3> >(cat)
./big_script.sh -o /dev/fd/3 2>&1 >big_script.log
exec 3>&-

However, I want to run big_script.sh on a remote machine and all three channels (fd = 1, fd = 2 and fd = 3) exit the ssh program as separate ones. What is the best way to do this?

+3
source share
3 answers

nc (netcat) and tunnels? You can make your radio on your network this way!

+2

SSH tty, , . , , stdout stderr.

0

You can write files to a remote host, and then ssh remote tail -feach of the log files from your local computer.

0
source

Source: https://habr.com/ru/post/1777812/


All Articles