libnetconf2
1.1.48
NETCONF library for clients and servers
|
Server-side settings for SSH connections. More...
Functions | |
int | nc_server_ssh_add_authkey (const char *pubkey_base64, NC_SSH_KEY_TYPE type, const char *username) |
Add an authorized client SSH public key. This public key can be used for publickey authentication (for any SSH connection, even Call Home) afterwards. More... | |
int | nc_server_ssh_add_authkey_path (const char *pubkey_path, const char *username) |
Add an authorized client SSH public key. This public key can be used for publickey authentication (for any SSH connection, even Call Home) afterwards. More... | |
int | nc_server_ssh_del_authkey (const char *pubkey_path, const char *pubkey_base64, NC_SSH_KEY_TYPE type, const char *username) |
Remove an authorized client SSH public key. More... | |
void | nc_server_ssh_set_passwd_auth_clb (int(*passwd_auth_clb)(const struct nc_session *session, const char *password, void *user_data), void *user_data, void(*free_user_data)(void *user_data)) |
Set the callback for SSH password authentication. If none is set, local system users are used. More... | |
void | nc_server_ssh_set_interactive_auth_clb (int(*interactive_auth_clb)(const struct nc_session *session, const ssh_message msg, void *user_data), void *user_data, void(*free_user_data)(void *user_data)) |
Set the callback for SSH interactive authentication. If none is set, local system users are used. More... | |
void | nc_server_ssh_set_pubkey_auth_clb (int(*pubkey_auth_clb)(const struct nc_session *session, ssh_key key, void *user_data), void *user_data, void(*free_user_data)(void *user_data)) |
Set the callback for SSH public key authentication. If none is set, local system users are used. More... | |
void | nc_server_ssh_set_hostkey_clb (int(*hostkey_clb)(const char *name, void *user_data, char **privkey_path, char **privkey_data, NC_SSH_KEY_TYPE *privkey_type), void *user_data, void(*free_user_data)(void *user_data)) |
Set the callback for retrieving host keys. Any RSA, DSA, and ECDSA keys can be added. However, a maximum of one key of each type will be used during SSH authentication, later keys replacing the earlier ones. More... | |
int | nc_server_ssh_endpt_add_hostkey (const char *endpt_name, const char *name, int16_t idx) |
Add endpoint SSH host keys the server will identify itself with. Only the name is set, the key itself wil be retrieved using a callback. More... | |
int | nc_server_ssh_endpt_del_hostkey (const char *endpt_name, const char *name, int16_t idx) |
Delete endpoint SSH host key. Their order is preserved. More... | |
int | nc_server_ssh_endpt_mov_hostkey (const char *endpt_name, const char *key_mov, const char *key_after) |
Move endpoint SSH host key. More... | |
int | nc_server_ssh_endpt_mod_hostkey (const char *endpt_name, const char *name, const char *new_name) |
Modify endpoint SSH host key. More... | |
int | nc_server_ssh_endpt_set_auth_methods (const char *endpt_name, int auth_methods) |
Set endpoint accepted SSH authentication methods. All (publickey, password, interactive) are supported by default. More... | |
int | nc_server_ssh_endpt_get_auth_methods (const char *endpt_name) |
Get endpoint accepted SSH authentication methods. More... | |
int | nc_server_ssh_endpt_set_auth_attempts (const char *endpt_name, uint16_t auth_attempts) |
Set endpoint SSH authentication attempts of every client. 3 by default. More... | |
int | nc_server_ssh_endpt_set_auth_timeout (const char *endpt_name, uint16_t auth_timeout) |
Set endpoint SSH authentication timeout. 30 seconds by default. More... | |
Server-side settings for SSH connections.
int nc_server_ssh_add_authkey | ( | const char * | pubkey_base64, |
NC_SSH_KEY_TYPE | type, | ||
const char * | username | ||
) |
Add an authorized client SSH public key. This public key can be used for publickey authentication (for any SSH connection, even Call Home) afterwards.
[in] | pubkey_base64 | Authorized public key binary content encoded in base64. |
[in] | type | Authorized public key SSH type. |
[in] | username | Username that the client with the public key must use. |
int nc_server_ssh_add_authkey_path | ( | const char * | pubkey_path, |
const char * | username | ||
) |
Add an authorized client SSH public key. This public key can be used for publickey authentication (for any SSH connection, even Call Home) afterwards.
[in] | pubkey_path | Path to the public key. |
[in] | username | Username that the client with the public key must use. |
int nc_server_ssh_del_authkey | ( | const char * | pubkey_path, |
const char * | pubkey_base64, | ||
NC_SSH_KEY_TYPE | type, | ||
const char * | username | ||
) |
Remove an authorized client SSH public key.
[in] | pubkey_path | Path to an authorized public key. NULL matches all the keys. |
[in] | pubkey_base64 | Authorized public key content. NULL matches any key. |
[in] | type | Authorized public key type. 0 matches all types. |
[in] | username | Username for an authorized public key. NULL matches all the usernames. |
void nc_server_ssh_set_passwd_auth_clb | ( | int(*)(const struct nc_session *session, const char *password, void *user_data) | passwd_auth_clb, |
void * | user_data, | ||
void(*)(void *user_data) | free_user_data | ||
) |
Set the callback for SSH password authentication. If none is set, local system users are used.
[in] | passwd_auth_clb | Callback that should authenticate the user. Username can be directly obtained from session . Zero return indicates success, non-zero an error. |
[in] | user_data | Optional arbitrary user data that will be passed to passwd_auth_clb . |
[in] | free_user_data | Optional callback that will be called during cleanup to free any user_data . |
void nc_server_ssh_set_interactive_auth_clb | ( | int(*)(const struct nc_session *session, const ssh_message msg, void *user_data) | interactive_auth_clb, |
void * | user_data, | ||
void(*)(void *user_data) | free_user_data | ||
) |
Set the callback for SSH interactive authentication. If none is set, local system users are used.
[in] | interactive_auth_clb | Callback that should authenticate the user. Zero return indicates success, non-zero an error. |
[in] | user_data | Optional arbitrary user data that will be passed to passwd_auth_clb . |
[in] | free_user_data | Optional callback that will be called during cleanup to free any user_data . |
void nc_server_ssh_set_pubkey_auth_clb | ( | int(*)(const struct nc_session *session, ssh_key key, void *user_data) | pubkey_auth_clb, |
void * | user_data, | ||
void(*)(void *user_data) | free_user_data | ||
) |
Set the callback for SSH public key authentication. If none is set, local system users are used.
[in] | pubkey_auth_clb | Callback that should authenticate the user. Zero return indicates success, non-zero an error. |
[in] | user_data | Optional arbitrary user data that will be passed to passwd_auth_clb . |
[in] | free_user_data | Optional callback that will be called during cleanup to free any user_data . |
void nc_server_ssh_set_hostkey_clb | ( | int(*)(const char *name, void *user_data, char **privkey_path, char **privkey_data, NC_SSH_KEY_TYPE *privkey_type) | hostkey_clb, |
void * | user_data, | ||
void(*)(void *user_data) | free_user_data | ||
) |
Set the callback for retrieving host keys. Any RSA, DSA, and ECDSA keys can be added. However, a maximum of one key of each type will be used during SSH authentication, later keys replacing the earlier ones.
[in] | hostkey_clb | Callback that should return the key itself. Zero return indicates success, non-zero an error. On success exactly ONE of privkey_path or privkey_data is expected to be set. The one set will be freed.
|
[in] | user_data | Optional arbitrary user data that will be passed to hostkey_clb . |
[in] | free_user_data | Optional callback that will be called during cleanup to free any user_data . |
int nc_server_ssh_endpt_add_hostkey | ( | const char * | endpt_name, |
const char * | name, | ||
int16_t | idx | ||
) |
Add endpoint SSH host keys the server will identify itself with. Only the name is set, the key itself wil be retrieved using a callback.
[in] | endpt_name | Existing endpoint name. |
[in] | name | Arbitrary name of the host key. |
[in] | idx | Optional index where to add the key. -1 adds at the end. |
int nc_server_ssh_endpt_del_hostkey | ( | const char * | endpt_name, |
const char * | name, | ||
int16_t | idx | ||
) |
Delete endpoint SSH host key. Their order is preserved.
[in] | endpt_name | Existing endpoint name. |
[in] | name | Name of the host key. NULL matches all the keys, but if idx != -1 then this must be NULL. |
[in] | idx | Index of the hostkey. -1 matches all indices, but if name != NULL then this must be -1. |
int nc_server_ssh_endpt_mov_hostkey | ( | const char * | endpt_name, |
const char * | key_mov, | ||
const char * | key_after | ||
) |
Move endpoint SSH host key.
[in] | endpt_name | Exisitng endpoint name. |
[in] | key_mov | Name of the host key that will be moved. |
[in] | key_after | Name of the key that will preceed key_mov . NULL if key_mov is to be moved at the beginning. |
int nc_server_ssh_endpt_mod_hostkey | ( | const char * | endpt_name, |
const char * | name, | ||
const char * | new_name | ||
) |
Modify endpoint SSH host key.
[in] | endpt_name | Exisitng endpoint name. |
[in] | name | Name of an existing host key. |
[in] | new_name | New name of the host key name . |
int nc_server_ssh_endpt_set_auth_methods | ( | const char * | endpt_name, |
int | auth_methods | ||
) |
Set endpoint accepted SSH authentication methods. All (publickey, password, interactive) are supported by default.
[in] | endpt_name | Existing endpoint name. |
[in] | auth_methods | Accepted authentication methods bit field of NC_SSH_AUTH_TYPE. |
int nc_server_ssh_endpt_get_auth_methods | ( | const char * | endpt_name | ) |
Get endpoint accepted SSH authentication methods.
[in] | endpt_name | Existing endpoint name. |
int nc_server_ssh_endpt_set_auth_attempts | ( | const char * | endpt_name, |
uint16_t | auth_attempts | ||
) |
Set endpoint SSH authentication attempts of every client. 3 by default.
[in] | endpt_name | Existing endpoint name. |
[in] | auth_attempts | Failed authentication attempts before a client is dropped. |
int nc_server_ssh_endpt_set_auth_timeout | ( | const char * | endpt_name, |
uint16_t | auth_timeout | ||
) |
Set endpoint SSH authentication timeout. 30 seconds by default.
[in] | endpt_name | Existing endpoint name. |
[in] | auth_timeout | Number of seconds before an unauthenticated client is dropped. |