Package libssh2-docs

Documentation for libssh2

http://www.libssh2.org/

The libssh2-docs package contains man pages and examples for
developing applications that use libssh2.

Library Functions (Section 3)
libssh2_agent_connect
Connect to an ssh-agent running on the system. Call libssh2_agent_disconnect(3) to close the connection after you're doing using it.
libssh2_agent_disconnect
Close a connection to an ssh-agent.
libssh2_agent_free
Free an ssh-agent handle. This function also frees the internal collection of public keys.
libssh2_agent_get_identity
libssh2_agent_get_identity(3) allows an application to iterate over all public keys in the collection managed by ssh-agent. store should point to a pointer that...
libssh2_agent_init
Init an ssh-agent handle. Returns the handle to an internal representation of an ssh-agent connection. After the successful initialization, an application can...
libssh2_agent_list_identities
Request an ssh-agent to list of public keys, and stores them in the internal collection of the handle. Call libssh2_agent_get_identity(3) to get a public key...
libssh2_agent_userauth
agent - ssh-agent handle as returned by libssh2_agent_init(3) username - Remote user name to authenticate as. identity - Public key to authenticate with, as...
libssh2_banner_set
This function is DEPRECATED. Use libssh2_session_banner_set(3) instead! session - Session instance as returned by libssh2_session_init_ex(3) banner - A pointer...
libssh2_base64_decode
This function is deemed DEPRECATED and will be removed from libssh2 in a future version. Don't use it! Decode a base64 chunk and store it into a newly allocated...
libssh2_channel_close
channel - active channel stream to set closed status on. Close an active data channel. In practice this means sending an SSH_MSG_CLOSE packet to the remote host...
libssh2_channel_direct_tcpip
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_direct_tcpip_ex(3).
libssh2_channel_direct_tcpip_ex
session - Session instance as returned by libssh2_session_init_ex(3) host - Third party host to connect to using the SSH host as a proxy. port - Port on third...
libssh2_channel_eof
channel - active channel stream to set closed status on. Check if the remote host has sent an EOF status for the selected stream.
libssh2_channel_exec
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_process_startup(3).
libssh2_channel_flush
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_flush_ex(3).
libssh2_channel_flush_ex
channel - Active channel stream to flush. streamid - Specific substream number to flush. Groups of substreams may be flushed by passing on of the following...
libssh2_channel_flush_stderr
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_flush_ex(3).
libssh2_channel_forward_accept
listener is a forwarding listener instance as returned by libssh2_channel_forward_listen_ex(3).
libssh2_channel_forward_cancel
listener - Forwarding listener instance as returned by libssh2_channel_forward_listen_ex(3) Instruct the remote host to stop listening for new connections on a...
libssh2_channel_forward_listen
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_forward_listen_ex(3).
libssh2_channel_forward_listen_ex
Instruct the remote SSH server to begin listening for inbound TCP/IP connections. New connections will be queued by the library until accepted by...
libssh2_channel_free
channel - Channel stream to free. Release all resources associated with a channel stream. If the channel has not yet been closed with libssh2_channel_close(3) ...
libssh2_channel_get_exit_signal
channel - Closed channel stream to retrieve exit signal from. exitsignal - If not NULL, is populated by reference with the exit signal (without leading "SIG")...
libssh2_channel_get_exit_status
channel - Closed channel stream to retrieve exit status from. Returns the exit code raised by the process running on the remote host at the other end of the...
libssh2_channel_handle_extended_data
This function is deprecated. Use the libssh2_channel_handle_extended_data2(3) function instead! channel - Active channel stream to change extended data handling...
libssh2_channel_handle_extended_data2
channel - Active channel stream to change extended data handling on. ignore_mode - One of the three LIBSSH2_CHANNEL_EXTENDED_DATA_* Constants...
libssh2_channel_ignore_extended_data
This function is deprecated. Use the libssh2_channel_handle_extended_data2(3) function instead! This is a macro defined in a public libssh2 header file that is...
libssh2_channel_open_ex
session - Session instance as returned by libssh2_session_init_ex(3) channel_type - Channel type to open. Typically one of session, direct-tcpip, or...
libssh2_channel_open_session
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_open_ex(3).
libssh2_channel_process_startup
channel - Active session channel instance. request - Type of process to startup. The SSH2 protocol currently defines shell, exec, and subsystem as standard...
libssh2_channel_read
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_read_ex(3).
libssh2_channel_read_ex
Attempt to read data from an active channel stream. All channel streams have one standard I/O substream (stream_id == 0), and may have up to 2^32 extended data...
libssh2_channel_read_stderr
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_read_ex(3).
libssh2_channel_receive_window_adjust
This function is deprecated in 1.1. Use libssh2_channel_receive_window_adjust2(3)! Adjust the receive window for a channel by adjustment bytes. If the amount to...
libssh2_channel_receive_window_adjust2
Adjust the receive window for a channel by adjustment bytes. If the amount to be adjusted is less than LIBSSH2_CHANNEL_MINADJUST and force is 0 the adjustment...
libssh2_channel_request_pty
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_request_pty_ex(3).
libssh2_channel_request_pty_ex
channel - Previously opened channel instance such as returned by libssh2_channel_open_ex(3) term - Terminal emulation (e.g. vt102, ansi, etc...) term_len -...
libssh2_channel_request_pty_size
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_request_pty_size_ex(3).
libssh2_channel_request_pty_size_ex
No description.
libssh2_channel_send_eof
Tell the remote host that no further data will be sent on the specified channel. Processes typically interpret this as a closed stdin descriptor.
libssh2_channel_set_blocking
channel - channel stream to set or clean blocking status on. blocking - Set to a non-zero value to make the channel block, or zero to make it non-blocking...
libssh2_channel_setenv
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_setenv_ex(3).
libssh2_channel_setenv_ex
channel - Previously opened channel instance such as returned by libssh2_channel_open_ex(3) varname - Name of environment variable to set on the remote channel...
libssh2_channel_shell
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_process_startup(3).
libssh2_channel_subsystem
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_process_startup(3).
libssh2_channel_wait_closed
Enter a temporary blocking state until the remote host closes the named channel. Typically sent after libssh2_channel_close(3) in order to examine the exit...
libssh2_channel_wait_eof
Wait for the remote end to acknowledge an EOF request.
libssh2_channel_window_read
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_window_read_ex(3).
libssh2_channel_window_read_ex
Check the status of the read window. Returns the number of bytes which the remote end may send without overflowing the window limit read_avail (if passed) will...
libssh2_channel_window_write
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_window_write_ex(3).
libssh2_channel_window_write_ex
Check the status of the write window Returns the number of bytes which may be safely written on the channel without blocking. 'window_size_initial' (if passed)...
libssh2_channel_write
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_write_ex(3).
libssh2_channel_write_ex
Write data to a channel stream. All channel streams have one standard I/O substream (stream_id == 0), and may have up to 2^32 extended data streams as...
libssh2_channel_write_stderr
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_write_ex(3).
libssh2_channel_x11_req
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_channel_x11_req_ex(3).
libssh2_channel_x11_req_ex
channel - Previously opened channel instance such as returned by libssh2_channel_open_ex(3) single_connection - non-zero to only forward a single connection...
libssh2_exit
Exit the libssh2 functions and free's all memory used internal.
libssh2_free
Deallocate memory allocated by earlier call to libssh2 functions. It uses the memory allocation callbacks provided by the application, if any. Otherwise, this...
libssh2_hostkey_hash
session - Session instance as returned by libssh2_session_init_ex(3) hash_type - One of: LIBSSH2_HOSTKEY_HASH_MD5 or LIBSSH2_HOSTKEY_HASH_SHA1. Returns the...
libssh2_init
Initialize the libssh2 functions. This typically initialize the crypto library. It uses a global state, and is not thread safe -- you must make sure this...
libssh2_keepalive_config
Set how often keepalive messages should be sent. want_reply indicates whether the keepalive messages should request a response from the server. interval is...
libssh2_keepalive_send
Send a keepalive message if needed. seconds_to_next indicates how many seconds you can sleep after this call before you need to call it again.
libssh2_knownhost_add
We discourage use of this function as of libssh2 1.2.5. Instead we strongly urge users to use libssh2_knownhost_addc(3) instead, which as a more complete API...
libssh2_knownhost_addc
Adds a known host to the collection of known hosts identified by the 'hosts' handle. host is a pointer the host name in plain text or hashed. If hashed, it must...
libssh2_knownhost_check
Checks a host and its associated key against the collection of known hosts, and returns info back about the (partially) matched entry. host is a pointer the...
libssh2_knownhost_checkp
Checks a host and its associated key against the collection of known hosts, and returns info back about the (partially) matched entry. host is a pointer the...
libssh2_knownhost_del
Delete a known host entry from the collection of known hosts. entry is a pointer to a struct that you can extract with libssh2_knownhost_check(3) or...
libssh2_knownhost_free
Free a collection of known hosts.
libssh2_knownhost_get
libssh2_knownhost_get(3) allows an application to iterate over all known hosts in the collection. store should point to a pointer that gets filled in to point...
libssh2_knownhost_init
Init a collection of known hosts for this session. Returns the handle to an internal representation of a known host collection. Call libssh2_knownhost_free(3)...
libssh2_knownhost_readfile
Reads a collection of known hosts from a specified file and adds them to the collection of known hosts. filename specifies which file to read type specifies...
libssh2_knownhost_readline
Tell libssh2 to read a buffer as it if is a line from a known hosts file. line points to the start of the line len is the length of the line in bytes type...
libssh2_knownhost_writefile
Writes all the known hosts to the specified file using the specified file format. filename specifies what filename to create type specifies what file type it...
libssh2_knownhost_writeline
Converts a single known host to a single line of output for storage, using the 'type' output format. known identifies which particular known host buffer points...
libssh2_poll
This function is deprecated. Do note use. We encourage users to instead use the poll(3) or select(3) functions to check for socket activity or when specific...
libssh2_poll_channel_read
This function is deprecated. Do note use. libssh2_poll_channel_read(3) checks to see if data is available in the channel's read buffer. No attempt is made with...
libssh2_publickey_add
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_publickey_add_ex(3).
libssh2_publickey_add_ex
Add a public key entry
libssh2_publickey_init
No description.
libssh2_publickey_list_fetch
No description.
libssh2_publickey_list_free
No description.
libssh2_publickey_remove
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_publickey_remove_ex(3).
libssh2_publickey_remove_ex
No description.
libssh2_publickey_shutdown
No description.
libssh2_scp_recv
This function is DEPRECATED. Use libssh2_scp_recv2(3) instead! session - Session instance as returned by libssh2_session_init_ex(3) path - Full path and...
libssh2_scp_recv2
session - Session instance as returned by libssh2_session_init_ex(3) path - Full path and filename of file to transfer. That is the remote file name. sb -...
libssh2_scp_send
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_scp_send_ex(3).
libssh2_scp_send64
session - Session instance as returned by libssh2_session_init_ex(3) path - Full path and filename of file to transfer to. That is the remote file name. mode -...
libssh2_scp_send_ex
This function has been deemed deprecated since libssh2 1.2.6. See libssh2_scp_send64(3). session - Session instance as returned by libssh2_session_init_ex(3)...
libssh2_session_abstract
session - Session instance as returned by libssh2_session_init_ex(3) Return a pointer to where the abstract pointer provided to libssh2_session_init_ex(3) is...
libssh2_session_banner_get
Once the session has been setup and libssh2_session_handshake(3) has completed successfully, this function can be used to get the server id from the banner each...
libssh2_session_banner_set
session - Session instance as returned by libssh2_session_init_ex(3) banner - A pointer to a zero-terminated string holding the user defined banner Set the...
libssh2_session_block_directions
session - Session instance as returned by libssh2_session_init_ex(3) When any of libssh2 functions return LIBSSH2_ERROR_EAGAIN an application should wait for...
libssh2_session_callback_set
Sets a custom callback handler for a previously initialized session object. Callbacks are triggered by the receipt of special packets at the Transport layer. To...
libssh2_session_disconnect
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_session_disconnect_ex(3).
libssh2_session_disconnect_ex
session - Session instance as returned by libssh2_session_init_ex(3) reason - One of the Disconnect Reason constants. description - Human readable reason for...
libssh2_session_flag
Set options for the created session. flag is the option to set, while value is typically set to 1 or 0 to enable or disable the option.
libssh2_session_free
Frees all resources associated with a session instance. Typically called after libssh2_session_disconnect_ex(3)
libssh2_session_get_blocking
Returns 0 if the state of the session has previously be set to non-blocking and it returns 1 if the state was set to blocking.
libssh2_session_get_timeout
Returns the timeout (in milliseconds) for how long a blocking the libssh2 function calls may wait until they consider the situation an error and return...
libssh2_session_handshake
session - Session instance as returned by libssh2_session_init_ex(3) socket - Connected socket descriptor. Typically a TCP connection though the protocol allows...
libssh2_session_hostkey
Returns a pointer to the current host key, the value len points to will get the length of the key. The value type points to the type of hostkey which is one of...
libssh2_session_init
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_session_init_ex(3).
libssh2_session_init_ex
myalloc - Custom allocator function. Refer to the section on Callbacks for implementing an allocator callback. Pass a value of NULL to use the default system...
libssh2_session_last_errno
session - Session instance as returned by libssh2_session_init_ex(3) Determine the most recent error condition.
libssh2_session_last_error
session - Session instance as returned by libssh2_session_init_ex(3) errmsg - If not NULL, is populated by reference with the human readable form of the most...
libssh2_session_method_pref
session - Session instance as returned by libssh2_session_init_ex(3) method_type - One of the Method Type constants. prefs - Coma delimited list of preferred...
libssh2_session_methods
session - Session instance as returned by libssh2_session_init_ex(3) method_type - one of the method type constants: LIBSSH2_METHOD_KEX, LIBSSH2_METHOD_HOSTKEY...
libssh2_session_set_blocking
session - session instance as returned by libssh2_session_init_ex(3) blocking - Set to a non-zero value to make the channel block, or zero to make it...
libssh2_session_set_last_error
session - Session instance as returned by libssh2_session_init_ex(3) errcode - One of the error codes as defined in the public libssh2 header file. errmsg - If...
libssh2_session_set_timeout
Set the timeout in milliseconds for how long a blocking the libssh2 function calls may wait until they consider the situation an error and return...
libssh2_session_startup
Starting in libssh2 version 1.2.8 this function is considered deprecated. Use libssh2_session_handshake(3) instead. session - Session instance as returned by...
libssh2_session_supported_algs
session - An instance of initialized LIBSSH2_SESSION (the function will use its pointer to the memory allocation function). method_type - Method type. See .BR...
libssh2_sftp_close
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_close_handle(3).
libssh2_sftp_closedir
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_close_handle(3).
libssh2_sftp_close_handle
handle - SFTP File Handle as returned by libssh2_sftp_open_ex(3) or libssh2_sftp_opendir(3) (which is a macro). Close an active LIBSSH2_SFTP_HANDLE. Because...
libssh2_sftp_fsetstat
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_fstat_ex(3).
libssh2_sftp_fstat
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_fstat_ex(3).
libssh2_sftp_fstat_ex
handle - SFTP File Handle as returned by libssh2_sftp_open_ex(3) attrs - Pointer to an LIBSSH2_SFTP_ATTRIBUTES structure to set file metadata from or into...
libssh2_sftp_fsync
This function causes the remote server to synchronize the file data and metadata to disk (like fsync(2)). For this to work requires fsync@openssh.com support on...
libssh2_sftp_get_channel
sftp - SFTP instance as returned by libssh2_sftp_init(3) Return the channel of the given sftp handle.
libssh2_sftp_init
session - Session instance as returned by libssh2_session_init_ex(3) Open a channel and initialize the SFTP subsystem. Although the SFTP subsystem operates over...
libssh2_sftp_last_error
sftp - SFTP instance as returned by libssh2_sftp_init(3) Returns the last error code produced by the SFTP layer. Note that this only returns a sensible error...
libssh2_sftp_lstat
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_stat_ex(3).
libssh2_sftp_mkdir
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_mkdir_ex(3).
libssh2_sftp_mkdir_ex
sftp - SFTP instance as returned by libssh2_sftp_init(3) path - full path of the new directory to create. Note that the new directory's parents must all exist...
libssh2_sftp_open
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_open_ex(3).
libssh2_sftp_opendir
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_open_ex(3).
libssh2_sftp_open_ex
open filehandle for file on SFTP.
libssh2_sftp_read
handle is the SFTP File Handle as returned by libssh2_sftp_open_ex(3) buffer is a pointer to a pre-allocated buffer of at least buffer_maxlen bytes to read data...
libssh2_sftp_readdir
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_readdir_ex(3).
libssh2_sftp_readdir_ex
Reads a block of data from a LIBSSH2_SFTP_HANDLE and returns file entry information for the next entry, if any. handle - is the SFTP File Handle as returned by...
libssh2_sftp_readlink
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_symlink_ex(3).
libssh2_sftp_realpath
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_symlink_ex(3).
libssh2_sftp_rename
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_rename_ex(3).
libssh2_sftp_rename_ex
sftp - SFTP instance as returned by libssh2_sftp_init(3) sourcefile - Path and name of the existing filesystem entry sourcefile_len - Length of the path and...
libssh2_sftp_rewind
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_seek64(3).
libssh2_sftp_rmdir
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_rmdir_ex(3).
libssh2_sftp_rmdir_ex
Remove a directory from the remote file system. sftp - SFTP instance as returned by libssh2_sftp_init(3) sourcefile - Full path of the existing directory to...
libssh2_sftp_seek
Deprecated function. Use libssh2_sftp_seek64(3) instead! handle - SFTP File Handle as returned by libssh2_sftp_open_ex(3) offset - Number of bytes from the...
libssh2_sftp_seek64
handle - SFTP File Handle as returned by libssh2_sftp_open_ex(3) offset - Number of bytes from the beginning of file to seek to. Move the file handle's internal...
libssh2_sftp_setstat
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_stat_ex(3).
libssh2_sftp_shutdown
sftp - SFTP instance as returned by libssh2_sftp_init(3) Destroys a previously initialized SFTP session and frees all resources associated with it.
libssh2_sftp_stat
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_fstat_ex(3).
libssh2_sftp_stat_ex
sftp - SFTP instance as returned by libssh2_sftp_init(3) path - Remote filesystem object to stat/lstat/setstat. path_len - Length of the name of the remote...
libssh2_sftp_statvfs
These functions provide statvfs(2)-like operations and require statvfs@openssh.com and fstatvfs@openssh.com extension support on the server. sftp - SFTP...
libssh2_sftp_symlink
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_symlink_ex(3).
libssh2_sftp_symlink_ex
Create a symlink or read out symlink information from the remote side. sftp - SFTP instance as returned by libssh2_sftp_init(3) path - Remote filesystem object...
libssh2_sftp_tell
handle - SFTP File Handle as returned by libssh2_sftp_open_ex(3). Returns the current offset of the file handle's internal pointer. Note that this is now...
libssh2_sftp_tell64
handle - SFTP File Handle as returned by libssh2_sftp_open_ex(3) Identify the current offset of the file handle's internal pointer.
libssh2_sftp_unlink
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_sftp_unlink_ex(3).
libssh2_sftp_unlink_ex
sftp - SFTP instance as returned by libssh2_sftp_init(3) filename - Path and name of the existing filesystem entry filename_len - Length of the path and name of...
libssh2_sftp_write
libssh2_sftp_write(3) writes a block of data to the SFTP server. This method is modeled after the POSIX write() function and uses the same calling semantics...
libssh2_trace
This is a function present in the library that can be used to get debug info from within libssh2 when it is running. Helpful when trying to trace or debug...
libssh2_trace_sethandler
libssh2_trace_sethandler installs a trace output handler for your application. By default, when tracing has been switched on via a call to libssh2_trace(), all...
libssh2_userauth_authenticated
session - Session instance as returned by libssh2_session_init_ex(3) Indicates whether or not the named session has been successfully authenticated.
libssh2_userauth_hostbased_fromfile
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_userauth_hostbased_fromfile_ex(3).
libssh2_userauth_hostbased_fromfile_ex
No description.
libssh2_userauth_keyboard_interactive
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_userauth_keyboard_interactive_ex(3).
libssh2_userauth_keyboard_interactive_ex
session - Session instance as returned by libssh2_session_init_ex(3). username - Name of user to attempt keyboard-interactive authentication for. username_len -...
libssh2_userauth_list
session - Session instance as returned by libssh2_session_init_ex(3) username - Username which will be used while authenticating. Note that most server...
libssh2_userauth_password
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_userauth_password_ex(3).
libssh2_userauth_password_ex
session - Session instance as returned by libssh2_session_init_ex(3) username - Name of user to attempt plain password authentication for. username_len - Length...
libssh2_userauth_publickey
Authenticate with the sign_callback callback that matches the prototype below
libssh2_userauth_publickey_fromfile
This is a macro defined in a public libssh2 header file that is using the underlying function libssh2_userauth_publickey_fromfile_ex(3).
libssh2_userauth_publickey_fromfile_ex
session - Session instance as returned by libssh2_session_init_ex(3) username - Pointer to user name to authenticate as. username_len - Length of username...
libssh2_userauth_publickey_frommemory
This function allows to authenticate a session with a public key read from memory. It's only supported when libssh2 is backed by OpenSSL. session - Session...
libssh2_version
If required_version is lower than or equal to the version number of the libssh2 in use, the version number of libssh2 is returned as a pointer to a zero...