Subject: Re: [libssh2] (no subject)

Re: [libssh2] (no subject)

From: Chris Nystrom <>
Date: Thu, 18 Oct 2007 13:58:02 -0500

On 9/10/07, Paul Thomas <> wrote:
> So I take it no one out there has any idea how to actually get things going
> with this library?

I have my own library that encapsulates libssh2 to make it easier to
use. I call it ssh2_lib.
Here is an example running a remote command.

/* exmaple1.c */

#include "ssh2_lib.h"
#include <stdio.h>
#include "../sock_lib/sock_lib.h"

#define SSH_PORT (22)

int main(int argc, char *argv[])
        int sock;
        sock = init_tcp_client("", SSH_PORT);
        if (sock <= 0) {
                return (-1);
        if (init_session(sock, "cnystrom", "xxxxxx") != 0) {
                return (-1);
        if (remote_command("/bin/touch testx3")) {
                printf("Remote command failed.\n");
        } else {
                printf("Remote command succeeded.\n");
        printf("all done\n--\n");
        return 0;

This email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>
libssh2-devel mailing list
Received on 2007-10-18