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

Remote connection to linux server


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_session my_ssh_session = ssh_new();

        if (my_ssh_session == NULL)

        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",
                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

RE: Remote connection to linux server"Charles@Hinet" <cylee@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org