Hi, how about to provide a simple way to forward raw file descriptors through ssh tunnels. something which may provide a way to write something like : (echo 3; read > out3) |& exec 3<&p 4>&p echo 5 >| out5 exec 5<> out5 echo 1 | ssh -d 3:rd -d 4:wr -d 5:rw ' read <&3; echo $REPLY >&4 read; echo $REPLY read <&5; echo $REPLY >&5 ' > out1 the expected result is 1 in out1, 3 in out3 and 5\n5 in out5. PS : hope the sample is right :-) Regards, Cyrille Lefevre -- mailto:Cyrille.Lefevre-lists at laposte.net
On Mon, Feb 07, 2011 at 15:56:29 -0600, Cyrille Lefevre wrote:> > Hi, > > how about to provide a simple way to forward raw file descriptors > through ssh tunnels. > > something which may provide a way to write something like : > > (echo 3; read > out3) |& > exec 3<&p 4>&p > echo 5 >| out5 > exec 5<> out5 > echo 1 | > ssh -d 3:rd -d 4:wr -d 5:rw ' > read <&3; echo $REPLY >&4 > read; echo $REPLY > read <&5; echo $REPLY >&5 > ' > out1 > > the expected result is 1 in out1, 3 in out3 and 5\n5 in out5. > > PS : hope the sample is right :-) > > Regards, > > Cyrille Lefevre > -- > mailto:Cyrille.Lefevre-lists at laposte.net >What problem are you hoping to solve with this? -- Iain Morgan
does this help for you? -W host:port Requests that standard input and output on the client be forwarded to host on port over the secure channel. Implies -N, -T, ExitOnForwardFailure and ClearAllForwardings and works with Protocol version 2 only. On Mon, Feb 7, 2011 at 10:56 PM, Cyrille Lefevre <cyrille.lefevre-lists at laposte.net> wrote:> > Hi, > > how about to provide a simple way to forward raw file descriptors through > ssh tunnels. > > something which may provide a way to write something like : > > (echo 3; read > out3) |& > exec 3<&p 4>&p > echo 5 >| out5 > exec 5<> out5 > echo 1 | > ssh -d 3:rd -d 4:wr -d 5:rw ' > ? ? ? ?read <&3; echo $REPLY >&4 > ? ? ? ?read; echo $REPLY > ? ? ? ?read <&5; echo $REPLY >&5 > ' > out1 > > the expected result is 1 in out1, 3 in out3 and 5\n5 in out5. > > PS : hope the sample is right :-) > > Regards, > > Cyrille Lefevre > -- > mailto:Cyrille.Lefevre-lists at laposte.net > > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >
Le 08/02/2011 18:01, Markus Friedl a ?crit :>does this help for you?> > -W host:port no since the other end has to be a socket... Regards, Cyrille Lefevre -- mailto:Cyrille.Lefevre-lists at laposte.net
so you just want to multiplex several file descriptors over a single ssh connection? -M can do that for you. or do you need a single process on the remote host? On Tue, Feb 8, 2011 at 9:51 PM, Cyrille Lefevre <cyrille.lefevre-lists at laposte.net> wrote:> > Le 08/02/2011 18:01, Markus Friedl a ?crit : >> >> does this help for you? > >> >> ? ? ?-W host:port > > no since the other end has to be a socket... > > Regards, > > Cyrille Lefevre > -- > mailto:Cyrille.Lefevre-lists at laposte.net > > > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >
Le 08/02/2011 23:14, Markus Friedl a ?crit :> > so you just want to multiplex several file descriptors over a single > ssh connection? > -M can do that for you. or do you need a single process on the remote host?neither, I already know and use -M in another circonstance. -M allow you to multiplex several child connexions over a single master connexion, this has nothing to do w/ file descriptors. imagine that I want to communicate w/ a remote process w/ more than the only 3 standard file descriptors. Regards, Cyrille Lefevre -- mailto:Cyrille.Lefevre-lists at laposte.net
Le 08/02/2011 21:57, Cyrille Lefevre a ?crit :> Le 08/02/2011 16:43, Robin David Hammond a ?crit : >> perhaps you can use netcat as an interim measure. > > also tried w/o success. another problem is the port assignment, > the more you need extra dfs, the more you need netcat processes and > ports. also, same problem as netpipes, not available anywhere. > > IMHO, the inside ssh solution is the more appropriate since anything > seems to be here, if ssh maintainers are ok to integrate this feature, I > may > try to add it to ssh.up Regards, Cyrille Lefevre -- mailto:Cyrille.Lefevre-lists at laposte.net
On 02/07/2011 10:56 PM, Cyrille Lefevre wrote:> > Hi, > > how about to provide a simple way to forward raw file descriptors > through ssh tunnels. > > something which may provide a way to write something like : > > (echo 3; read > out3) |& > exec 3<&p 4>&p > echo 5 >| out5 > exec 5<> out5 > echo 1 | > ssh -d 3:rd -d 4:wr -d 5:rw ' > read <&3; echo $REPLY >&4 > read; echo $REPLY > read <&5; echo $REPLY >&5 > ' > out1 > > the expected result is 1 in out1, 3 in out3 and 5\n5 in out5. > > PS : hope the sample is right :-) > > Regards, > > Cyrille LefevreBeing able to forward extra streams could also be used to forward /dev/pty decoupled from stdin and stdout. For instance, with the current implementation, if the following command... $ ssh foo -t ssh bar cat /var/data >/tmp/data ... is run from some account requiring password authentication on "bar" the password prompt generated by the ssh client running on "foo" doesn't appear on the local console but goes into "/tmp/data". Also, on some operating systems (i.e. HP-UX or AIX) ptys are not reliable and may silently drop data when internal buffers overflow so piping data trough them as in the example above may corrupt the local "/tmp/data". A decoupled forwarding of /dev/pty would solve both problems. - Salva