Are there OpenSSH library coding examples

Damien Miller djm at mindrot.org
Wed May 24 12:35:16 EST 2006


On Tue, 23 May 2006, ron flory wrote:

> Hi-
> 
>   Apologies in advance if this is off-topic, but I've been
> unable to find any coding or usage examples on how to open a
> SSH client to a remote server.  I'll happily RTFM if I can just
> find the FM (!).  The client environment is x86 Linux 2.6.x,
> the remote SSH servers will be on proprietary embedded devices.

It would be nice to offer a SSH client API, but we don't have one
yet. libssh.a certainly isn't a client API, just an internal thing
for functions shared between the various tools.

The only way at present is to open the ssh client as a subprocess.
This is what scp and sftp do, and it works very well. I suggest that
you have a look at the sftp.c:connect_to_server() function to see how
it is done there - it is very straightforward.

-d




More information about the openssh-unix-dev mailing list