1libssh2_userauth_keyboard_interacltiibvslesi_hbe2sxs(mh3a2)n_uuaslerauth_keyboard_interactive_ex(3)
2
3
4
6 libssh2_userauth_keyboard_interactive_ex - authenticate a session using
7 keyboard-interactive authentication
8
10 #include <libssh2.h>
11
12 int
13 libssh2_userauth_keyboard_interactive_ex(LIBSSH2_SESSION *session,
14 const char *username,
15 unsigned int username_len,
16 LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC(*response_callback));
17
19 session - Session instance as returned by libssh2_session_init_ex(3).
20
21 username - Name of user to attempt keyboard-interactive authentication
22 for.
23
24 username_len - Length of username parameter.
25
26 response_callback - As authentication proceeds, the host issues several
27 (1 or more) challenges and requires responses. This callback will be
28 called at this moment. The callback is responsible to obtain responses
29 for the challenges, fill the provided data structure and then return
30 control. Responses will be sent to the host. String values will be
31 free(3)ed by the library. The callback prototype must match this:
32
33 void response(const char *name,
34 int name_len, const char *instruction,
35 int instruction_len,
36 int num_prompts,
37 const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts,
38 LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses,
39 void **abstract);
40
41 Attempts keyboard-interactive (challenge/response) authentication.
42
43 Note that many SSH servers will always issue a single "password" chal‐
44 lenge, requesting actual password as response, but it is not required
45 by the protocol, and various authentication schemes, such as smartcard
46 authentication may use keyboard-interactive authentication type too.
47
49 Return 0 on success or negative on failure. It returns LIB‐
50 SSH2_ERROR_EAGAIN when it would otherwise block. While LIB‐
51 SSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per
52 se.
53
55 LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed.
56
57 LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
58
59 IBSSH2_ERROR_AUTHENTICATION_FAILED - failed, invalid username/password
60 or public/private key.
61
63 libssh2_session_init_ex(3)
64
65
66
67libssh2 0.19 8lMiabrss2h020_8userauth_keyboard_interactive_ex(3)