libnetconf2
3.5.1
NETCONF server and client library in C.
|
Server-side settings for SSH connections. More...
Typedefs | |
typedef int(* | nc_server_ssh_interactive_auth_clb )(const struct nc_session *session, ssh_session ssh_sess, ssh_message msg, void *user_data) |
Keyboard interactive authentication callback. More... | |
Functions | |
int | nc_server_ssh_kbdint_get_nanswers (const struct nc_session *session, ssh_session libssh_session) |
Get the number of answers to Keyboard interactive authentication prompts. More... | |
int | nc_server_ssh_set_authkey_path_format (const char *path) |
Set the format of the path to authorized_keys files. More... | |
void | nc_server_ssh_set_interactive_auth_clb (nc_server_ssh_interactive_auth_clb auth_clb, void *user_data, void(*free_user_data)(void *user_data)) |
Set the callback for SSH interactive authentication. More... | |
int | nc_server_ssh_set_pam_conf_filename (const char *filename) |
Set the name of the PAM configuration file. More... | |
Server-side settings for SSH connections.
typedef int(* nc_server_ssh_interactive_auth_clb)(const struct nc_session *session, ssh_session ssh_sess, ssh_message msg, void *user_data) |
Keyboard interactive authentication callback.
The callback has to handle sending interactive challenges and receiving responses by itself. An example callback may fit the following description: Prepare all prompts for the user and send them via ssh_message_auth_interactive_request()
. Get the answers either by calling ssh_message_get()
or nc_server_ssh_kbdint_get_nanswers()
. Return value based on your authentication logic and user answers retrieved by calling ssh_userauth_kbdint_getanswer()
.
[in] | session | NETCONF session. |
[in] | ssh_sess | libssh session. |
[in] | msg | SSH message that contains the interactive request and which expects a reply with prompts. |
[in] | user_data | Arbitrary user data. |
Definition at line 514 of file session_server.h.
int nc_server_ssh_set_authkey_path_format | ( | const char * | path | ) |
Set the format of the path to authorized_keys files.
This path format will be set globally for all clients wishing to authenticate via the SSH Public Key system authentication.
[in] | path | Path to authorized_keys files. The path may contain the following tokens:
|
void nc_server_ssh_set_interactive_auth_clb | ( | nc_server_ssh_interactive_auth_clb | auth_clb, |
void * | user_data, | ||
void(*)(void *user_data) | free_user_data | ||
) |
Set the callback for SSH interactive authentication.
[in] | auth_clb | Keyboard interactive authentication callback. This callback is only called once per authentication. |
[in] | user_data | Optional arbitrary user data that will be passed to interactive_auth_clb . |
[in] | free_user_data | Optional callback that will be called during cleanup to free any user_data . |
int nc_server_ssh_kbdint_get_nanswers | ( | const struct nc_session * | session, |
ssh_session | libssh_session | ||
) |
Get the number of answers to Keyboard interactive authentication prompts.
The actual answers can later be retrieved by calling ssh_userauth_kbdint_getanswer()
on the libssh_session
.
[in] | session | NETCONF session. |
[in] | libssh_session | libssh session. |
int nc_server_ssh_set_pam_conf_filename | ( | const char * | filename | ) |
Set the name of the PAM configuration file.
This filename will be set globally for all clients wishing to authenticate via the SSH Keyboard Interactive authentication method.
[in] | filename | Name of the PAM configuration file. The file needs to be located in the default PAM directory (usually /etc/pam.d/). |