1

I would like to read input on a named pipe on a remote server from my local machine. I have a script on the remote server that is triggered as a CRON job. So every now and then by script writes something to the named pipe. Due to firewall restrictions I am only allowed to connect to the server from my local machine and not the other way around.

So far I have this working by using socat to SSH to the remote server and read the input from the remote named pipe into a named pipe on the local machine.

When I have written once to the named pipe on the remote machine I see the input on the local machine's named pipe. Any new writings to the named pipe though is never seen on my local machine. It only works once.

The command that I execute on my local machine looks like this:

$ socat PIPE:/tmp/local/local.pipe SYSTEM:"ssh admin@172.16.0.100 \
   socat - /tmp/remote/server/remote.pipe"

Any suggestions of how to make the transfer of input to the remote named pipe come through to the local machine forever?

slm
  • 7,355
  • 16
  • 54
  • 72
Cyberlurk
  • 111
  • 1
  • Same thing happens with this as well - `socat PIPE:/tmp/local.pipe SYSTEM:"ssh root@server.mydom.com socat - /dev/urandom"`. I suspect it's something to do w/ the `ssh` - https://www.linux.com/news/socat-general-bidirectional-pipe-handler. – slm Jun 17 '18 at 02:52

0 Answers0