www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Exec-Channel through intermediate host

Exec-Channel through intermediate host

From: <lars.lindstrom_at_gmx.at>
Date: Wed, 21 May 2014 17:20:06 +0200

Hi!
 
Please imagine the following configuration:

A------------------------------------+
| Application 1 (libssh2)            |
|                            1.0.0.1 |
+------------------------------------+
                                   ^
                                   |
                                   v
B------------------------------------+
|                            1.0.0.2 |
| 2.0.0.1                            |
+------------------------------------+
        ^
        |
        v
C------------------------------------+
| 2.0.0.2                            |
|                      Application 2 |
+------------------------------------+

The application 1 (based on libssh2), running on host A is required to execute
and retrieve the standard output of the application 2 running on host C. There
is no direct link between host A and host C, but rather host C is reachable
through the intermediate host B (both require password authentication).

So an exec-channel through an intermediate host is required, and I'm now
looking for a decent way to do this using libssh2.

As far as I can tell from the documentation, I would need to create a
direct-tcpip-channel to tunnel the exec-channel through the intermediate host
B. To create the exec-channel, however, a session is required which itself
requires a socket (which is not available for the direct-tcpip-channel, which
requires libssh2_channel_read/write to get data through, not read/write). This
means that I need to create another pair of sockets (maybe a unix domain socket)
to loop the data through (the direct-tcpip-session and the exec-session) - which
I want to avoid.

So are there any options to establish a 'direct' exec-channel through an
intermediate host (without acquiring an additional socketpair)? If not, what is
the preferred solution in this case?

Thanks!

br Lars
 

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2014-05-21

the libssh2 team