libssh2_userauth_keyboard_interactive_ex.3 (2344B)
1.TH libssh2_userauth_keyboard_interactive_ex 3 "8 Mar 2008" "libssh2 0.19" "libssh2" 2.SH NAME 3libssh2_userauth_keyboard_interactive_ex - authenticate a session using 4keyboard-interactive authentication 5.SH SYNOPSIS 6.nf 7#include <libssh2.h> 8 9int 10libssh2_userauth_keyboard_interactive_ex(LIBSSH2_SESSION *session, 11 const char *username, 12 unsigned int username_len, 13 LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC(*response_callback)); 14.fi 15.SH DESCRIPTION 16\fIsession\fP - Session instance as returned by 17\fIlibssh2_session_init_ex(3)\fP. 18 19\fIusername\fP - Name of user to attempt keyboard-interactive authentication 20for. 21 22\fIusername_len\fP - Length of username parameter. 23 24\fIresponse_callback\fP - As authentication proceeds, the host issues several 25(1 or more) challenges and requires responses. This callback will be called at 26this moment. The callback is responsible to obtain responses for the 27challenges, fill the provided data structure and then return 28control. Responses will be sent to the host. String values will be free(3)ed 29by the library. The callback prototype must match this: 30 31.nf 32void response(const char *name, 33 int name_len, const char *instruction, 34 int instruction_len, 35 int num_prompts, 36 const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts, 37 LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses, 38 void **abstract); 39.fi 40 41Attempts keyboard-interactive (challenge/response) authentication. 42 43Note that many SSH servers will always issue a single "password" challenge, 44requesting actual password as response, but it is not required by the 45protocol, and various authentication schemes, such as smartcard authentication 46may use keyboard-interactive authentication type too. 47.SH RETURN VALUE 48Return 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN 49when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative 50number, it is not really a failure per se. 51.SH ERRORS 52\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed. 53 54\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket. 55 56\fILIBSSH2_ERROR_AUTHENTICATION_FAILED\fP - failed, invalid username/password 57or public/private key. 58.SH SEE ALSO 59.BR libssh2_session_init_ex(3)