libssh
|
The ssh::Session class contains the state of a SSH connection. More...
#include <include/libssh/libsshpp.hpp>
Public Member Functions | |
Channel * | acceptForward (int timeout_ms) |
accept an incoming forward connection More... | |
void | connect () |
connects to the remote host More... | |
void | disconnect () |
Disconnects from the SSH server and closes connection. More... | |
int | getAuthList () |
Returns the available authentication methods from the server. More... | |
const char * | getDisconnectMessage () |
Returns the disconnect message from the server, if any. More... | |
std::string | getIssueBanner () |
gets the Issue banner from the ssh server More... | |
int | getOpensshVersion () |
returns the OpenSSH version (server) if possible More... | |
socket_t | getSocket () |
returns the file descriptor used for the communication More... | |
int | getVersion () |
returns the version of the SSH protocol being used More... | |
int | isServerKnown () |
verifies that the server is known More... | |
void | optionsCopy (const Session &source) |
copies options from a session to another More... | |
void | optionsParseConfig (const char *file) |
parses a configuration file for options More... | |
void | setOption (enum ssh_options_e type, const char *option) |
sets an SSH session options More... | |
void | setOption (enum ssh_options_e type, long int option) |
sets an SSH session options More... | |
void | setOption (enum ssh_options_e type, void *option) |
sets an SSH session options More... | |
void | silentDisconnect () |
silently disconnect from remote host More... | |
int | userauthKbdint (const char *username, const char *submethods) |
Authenticate through the "keyboard-interactive" method. More... | |
int | userauthKbdintGetNPrompts () |
Get the number of prompts (questions) the server has given. More... | |
int | userauthKbdintSetAnswer (unsigned int i, const char *answer) |
Set the answer for a question from a message block. More... | |
int | userauthNone () |
Authenticates using the "none" method. More... | |
int | userauthPassword (const char *password) |
Authenticates using the password method. More... | |
int | userauthPublickey (ssh_key privkey) |
Authenticates using the publickey method. More... | |
int | userauthPublickeyAuto (void) |
Authenticates automatically using public key. More... | |
int | userauthTryPublickey (ssh_key pubkey) |
Try to authenticate using the publickey method. More... | |
int | writeKnownhost () |
Writes the known host file with current host key. More... | |
The ssh::Session class contains the state of a SSH connection.
|
inline |
accept an incoming forward connection
[in] | timeout_ms | timeout for waiting, in ms |
References ssh_channel_accept_forward().
|
inline |
connects to the remote host
SshException | on error |
References ssh_connect().
|
inline |
Disconnects from the SSH server and closes connection.
References ssh_disconnect().
|
inline |
Returns the available authentication methods from the server.
SshException | on error |
References ssh_userauth_list().
|
inline |
Returns the disconnect message from the server, if any.
References ssh::SshException::getError(), ssh_get_disconnect_message(), ssh_get_error(), and ssh_get_error_code().
|
inline |
gets the Issue banner from the ssh server
References ssh_get_issue_banner().
|
inline |
returns the OpenSSH version (server) if possible
References ssh_get_openssh_version().
|
inline |
returns the file descriptor used for the communication
References ssh_get_fd().
|
inline |
returns the version of the SSH protocol being used
References ssh_get_version().
|
inline |
verifies that the server is known
SshException | on error |
|
inline |
copies options from a session to another
SshException | on error |
References ssh_options_copy().
|
inline |
parses a configuration file for options
SshException | on error |
[in] | file | configuration file name |
References ssh_options_parse_config().
|
inline |
sets an SSH session options
type | Type of option |
option | cstring containing the value of option |
SshException | on error |
References ssh_options_set().
|
inline |
sets an SSH session options
type | Type of option |
option | long integer containing the value of option |
SshException | on error |
References ssh_options_set().
|
inline |
sets an SSH session options
type | Type of option |
option | void pointer containing the value of option |
SshException | on error |
References ssh_options_set().
|
inline |
silently disconnect from remote host
References ssh_silent_disconnect().
|
inline |
Authenticate through the "keyboard-interactive" method.
[in] | The | username to authenticate. You can specify NULL if ssh_option_set_username() has been used. You cannot try two different logins in a row. |
[in] | Undocumented. | Set it to NULL. |
SshException | on error |
References ssh_userauth_kbdint().
|
inline |
Get the number of prompts (questions) the server has given.
References ssh_userauth_kbdint_getnprompts().
|
inline |
Set the answer for a question from a message block.
[in] | index | The number of the ith prompt. |
[in] | The | answer to give to the server. The answer MUST be encoded UTF-8. It is up to the server how to interpret the value and validate it. However, if you read the answer in some other encoding, you MUST convert it to UTF-8. |
SshException | on error |
References ssh_userauth_kbdint_setanswer().
|
inline |
Authenticates using the "none" method.
Prefer using autopubkey if possible.
SshException | on error |
References ssh_userauth_none().
|
inline |
Authenticates using the password method.
[in] | password | password to use for authentication |
SshException | on error |
References ssh_userauth_password().
|
inline |
Authenticates using the publickey method.
[in] | privkey | private key to use for authentication |
SshException | on error |
References ssh_userauth_publickey().
|
inline |
Authenticates automatically using public key.
SshException | on error |
References ssh_userauth_publickey_auto().
|
inline |
Try to authenticate using the publickey method.
[in] | pubkey | public key to use for authentication |
SshException | on error |
References ssh_userauth_try_publickey().
|
inline |
Writes the known host file with current host key.
SshException | on error |
References ssh_channel_cancel_forward(), ssh_channel_listen_forward(), and ssh_write_knownhost().