Ciprian Dorin, Craciun wrote:
>     Hello all!
>
>     Today I've played around with NBD (Network Block Disk), and
> qemu-nbd (a NBD client that exports QEMU disks as NBD's).
>
>     My problem is the following: both NBD kernel module and qemu-nbd
> implementation expect to use a socket in order to communicate.
>     This means that in order to securely tunnel the connection over
> SSH (OpenSSH), I need an intermediary process that creates a socket
> and forwards all input / output between this socket and stdin / stdout
> (which are in fact pipes received from OpenSSH).
>
>     My question is: can I somehow make the pair of stdin / stdout seem
> as a socket to the Linux syscalls (read and write)? (I would have to
> make stdin / stdout pair look like a single file descriptor.) (This
> would eliminate the intermediate process that just pipes data, and
> thus reduce the overhead.)
>   

Something like socat should to do the trick.

For instance, if you have qemu-nbd on localhost:1025:

ssh -l user hostname.com socat stdio tcp:localhost:1025

Alternative, you could just do ssh based port forwarding.  For instance:

ssh -l user -L 1025:localhost:1025 hostname.com

And then connect locally with nbd-client

Regards,

Anthony Liguori

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to