[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Remote connection to linux server


Hi,

 

What version are you using?

 

I got the same error on 0.7.0, but 0.6.5 was OK on Windows 7/2012R2.

 

Charles

 

From: Gigin Jose (RBEI/EIA1) [mailto:Gigin.Jose@xxxxxxxxxxxx] 
Sent: Tuesday, May 19, 2015 4:17 PM
To: libssh@xxxxxxxxxx
Subject: Remote connection to linux server

 

Hi, 

 

I am trying to use libssh library for developing ssh client application on
windows PC. The client application connects to ssh server running on remote
ubuntu linux PC. The authentication system on the remote ubuntu is using a
username and password. 

Is it possible to establish the remote connection using libssh library. 

My following code gives me an error connecting to the remote host:

 

        int rc;

        int state;

        int hlen;

        char *password = "pass123";

        unsigned char *hash = NULL;

        ssh_scp scp;

        //ssh_session my_ssh_session;

 

        ssh_init();

        ssh_session my_ssh_session = ssh_new();

 

        if (my_ssh_session == NULL)

                exit(-1);

 

        int verbosity = SSH_LOG_PROTOCOL;

        int port = 22;

        int set_options;

 

        set_options = ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST,
"user@remoteip");

        set_options = ssh_options_set(my_ssh_session,
SSH_OPTIONS_LOG_VERBOSITY, &verbosity);

        set_options = ssh_options_set(my_ssh_session, SSH_OPTIONS_PORT,
&port);

        ssh_options_set(my_ssh_session, SSH_OPTIONS_USER, "user");

 

        rc = ssh_connect(my_ssh_session);

        if (rc != SSH_OK)

        {

                fprintf(stderr, "Error connecting to localhost: %s\n",

                        ssh_get_error(my_ssh_session));

                //exit(-1);

        }

        else

                fprintf(stdout,"CONNECTION ESTABLISHED !! \n");

 

        rc = ssh_userauth_password(my_ssh_session, "user", password);

 

 

The error says: Error connecting to localhost: crypt_set_algorithms2: no
crypto algorithm function found for 3des-cbc. The api ssh_connect()return
-1, and the api ssh_userauth_password retruns 4. 

 

Why is this  ? Do I need to use separate libraries for authenticating with
password ? 

 

Thank You

With Regards

Gigin

 

 


Follow-Ups:
Re: Remote connection to linux serverAndreas Schneider <asn@xxxxxxxxxxxxxx>
References:
Remote connection to linux server"Gigin Jose (RBEI/EIA1)" <Gigin.Jose@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org