Hi,
I am using the windows port of libssh2 v1.8.0 for setting ssh sessions to
linux and mac hosts.
I have now started adding code to figure out the authentication methods and
then performing relevant actions. So my code looks something like this :
--- for (std::string authMethod : *authMethodsList) { if (authMethod.compare("password") == 0) { if (libssh2_userauth_password(mSshSession, usr, passwd)) { authStatus = false; } else { authStatus = true; break; } } else if (authMethod.compare("publickey") == 0) { // TODO auth!! } else if (authMethod.compare("keyboard-interactive") == 0) { // set the password in the session // char* localPass = _strdup(passwd); void **sessionAbstract = libssh2_session_abstract(mSshSession); *sessionAbstract = localPass; if (libssh2_userauth_keyboard_interactive(mSshSession, usr, &kbd_callback)) { authStatus = false; free(localPass); } else { authStatus = true; free(localPass); break; } } } --- Now there are two issues here : 1. While processing "password" method, the method sometimes fails with authentication failure error. This happens when the same username password works perfectly using other ssh clients. 2. Processing "keyboard-interactive" method, the response callback(kbd_callback) passed to libssh2_userauth_keyboard_interactive() is never called. The error message seen in this case is "Waiting for keyboard USERAUTH response". Can someone provide pointers as to how to resolve the above two issues? Thanks in advance. --eminemence. ------- flaminghorns.com - Coding, mobile apps and much more.. <http://flaminghorns.com> -------
_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2019-04-04