www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Need help with libssh2_userauth_keyboard_interactive method.

Need help with libssh2_userauth_keyboard_interactive method.

From: Velichko Yuriy <velichko.yuriy_at_gmail.com>
Date: Thu, 28 Feb 2013 17:14:51 +0200

Hello everyone!

II try to use the libssh2 in my application. And I have question about the
libssh2_userauth_keyboard_interactive function.

I took the kbd_callback method from examples:

static void kbd_callback(

                 const char *name,

                  int name_len,

                  const char *instruction,

                  int instruction_len,

                  int num_prompts,

                  const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts,

                  LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses,

                  void **abstract )






    if (num_prompts == 1) {

        responses[0].text = strdup(password);

        responses[0].length = strlen(password);





Here, the password is a global variable.

QUESTION: Is there a method to pass the variable into this function?

Best Regards!

libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2013-02-28

the libssh2 team