Home:ALL Converter>Connect to SUSE using libssh

Connect to SUSE using libssh

Ask Time:2017-09-14T20:52:39         Author:Iusti Boiculese

Json Formatter

I am trying to establish a connection using libssh(https://www.libssh.org/) to a machine with SUSE Enterprise operating system installed.

    ssh_options_set(tempSshSession, SSH_OPTIONS_HOST, host2Connect);
    ssh_options_set(tempSshSession, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
    ssh_options_set(tempSshSession, SSH_OPTIONS_PORT, &port);

    int rc = ssh_connect(tempSshSession);
    if(rc != SSH_OK) {
        printf("Error connecting to the localhost\n");
        exit(-1);
    }
    // Authorized by the password.
    rc = ssh_userauth_password(tempSshSession, username, password);

After ssh_userauth_password() call it returns the response : "SSH_AUTH_DENIED: Authentication failed: use another method"

It works fine for operating systems like: Ubuntu, Linux Generic and CentOS.

Thanks

Author:Iusti Boiculese,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/46219725/connect-to-suse-using-libssh
yy