libssh
0.10.90
The SSH library
|
#include <libsshpp.hpp>
Public Member Functions | |
void_throwable | setOption (enum ssh_options_e type, const char *option) |
sets an SSH session options | |
void_throwable | setOption (enum ssh_options_e type, long int option) |
sets an SSH session options | |
void_throwable | setOption (enum ssh_options_e type, void *option) |
sets an SSH session options | |
void_throwable | connect () |
connects to the remote host | |
int | userauthPublickeyAuto (void) |
Authenticates automatically using public key. | |
int | userauthNone () |
Authenticates using the "none" method. Prefer using autopubkey if possible. | |
int | userauthKbdint (const char *username, const char *submethods) |
Authenticate through the "keyboard-interactive" method. | |
int | userauthKbdintGetNPrompts () |
Get the number of prompts (questions) the server has given. | |
int | userauthKbdintSetAnswer (unsigned int index, const char *answer) |
Set the answer for a question from a message block. | |
int | userauthPassword (const char *password) |
Authenticates using the password method. | |
int | userauthTryPublickey (ssh_key pubkey) |
Try to authenticate using the publickey method. | |
int | userauthPublickey (ssh_key privkey) |
Authenticates using the publickey method. | |
int | getAuthList () |
Returns the available authentication methods from the server. | |
void | disconnect () |
Disconnects from the SSH server and closes connection. | |
const char * | getDisconnectMessage () |
Returns the disconnect message from the server, if any. | |
const char * | getError () |
int | getErrorCode () |
socket_t | getSocket () |
returns the file descriptor used for the communication | |
std::string | getIssueBanner () |
gets the Issue banner from the ssh server | |
int | getOpensshVersion () |
returns the OpenSSH version (server) if possible | |
int | getVersion () |
returns the version of the SSH protocol being used | |
int | isServerKnown () |
verifies that the server is known | |
void | log (int priority, const char *format,...) |
void_throwable | optionsCopy (const Session &source) |
copies options from a session to another | |
void_throwable | optionsParseConfig (const char *file) |
parses a configuration file for options | |
void | silentDisconnect () |
silently disconnect from remote host | |
int | writeKnownhost () |
Writes the known host file with current host key. | |
Channel * | acceptForward (int timeout_ms) |
accept an incoming forward connection | |
void_throwable | cancelForward (const char *address, int port) |
void_throwable | listenForward (const char *address, int port, int &boundport) |
ssh_session | getCSession () |
Protected Attributes | |
ssh_session | c_session |
Friends | |
class | Channel |
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 |
|
inline |
|
inline |
Disconnects from the SSH server and closes connection.
|
inline |
Returns the available authentication methods from the server.
SshException | on error |
|
inline |
Returns the disconnect message from the server, if any.
|
inline |
gets the Issue banner from the ssh server
|
inline |
returns the OpenSSH version (server) if possible
|
inline |
returns the file descriptor used for the communication
|
inline |
returns the version of the SSH protocol being used
|
inline |
verifies that the server is known
SshException | on error |
|
inline |
|
inline |
parses a configuration file for options
SshException | on error |
[in] | file | configuration file name |
|
inline |
sets an SSH session options
type | Type of option |
option | cstring containing the value of option |
SshException | on error |
|
inline |
sets an SSH session options
type | Type of option |
option | long integer containing the value of option |
SshException | on error |
|
inline |
sets an SSH session options
type | Type of option |
option | void pointer containing the value of option |
SshException | on error |
|
inline |
silently disconnect from remote host
|
inline |
Authenticate through the "keyboard-interactive" method.
[in] | username | 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] | submethods | Undocumented. Set it to NULL. |
SshException | on error |
|
inline |
Get the number of prompts (questions) the server has given.
|
inline |
Set the answer for a question from a message block.
[in] | index | The index number of the prompt. |
[in] | answer | 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 |
|
inline |
Authenticates using the "none" method. Prefer using autopubkey if possible.
SshException | on error |
|
inline |
Authenticates using the password method.
[in] | password | password to use for authentication |
SshException | on error |
|
inline |
Authenticates using the publickey method.
[in] | privkey | private key to use for authentication |
SshException | on error |
|
inline |
Authenticates automatically using public key.
SshException | on error |
|
inline |
Try to authenticate using the publickey method.
[in] | pubkey | public key to use for authentication |
SshException | on error |
|
inline |
Writes the known host file with current host key.
SshException | on error |