Builder

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Called when authentication skips a key because of policy. Must return promptly.

Link copied to clipboard

Whether to automatically disconnect the SSH connection when the last channel is closed.

Link copied to clipboard

Client version string sent during SSH handshake.

Link copied to clipboard

Maximum wait for sending the final disconnect packet during automatic last-channel shutdown or a key-exchange failure. Defaults to 5 seconds; 0 waits until the write completes or the connection is closed explicitly. Explicit SshClient.disconnect always aborts outstanding writes immediately.

Link copied to clipboard

Enable zlib compression. When true, the client offers zlib@openssh.com,zlib,none; when false, only none.

Link copied to clipboard
Link copied to clipboard

Environment variables sent before each session starts, including SFTP. Servers may ignore variables not allowed by their policy (OpenSSH AcceptEnv). Names and values use UTF-8 and must not contain NUL. Only supplied variables are sent.

Link copied to clipboard

Maximum wait for initial key exchange and service negotiation after version exchange, including host-key verification. Does not limit TCP connection, version exchange, authentication, or reads from an established session.

Link copied to clipboard

Hostname for TCP connections. Used with default KtorTcpTransport. Ignored if transportFactory is set explicitly.

Link copied to clipboard
Link copied to clipboard

Timeout for processing a server's host-key update, including proof requests and verifier persistence callbacks. Defaults to 30 seconds; 0 waits until completion or connection shutdown. Failed or timed-out updates do not replace trusted keys unless their proofs have been verified.

Link copied to clipboard

Host key verifier.

Link copied to clipboard

IP version preference for the default TCP transport. Ignored if transportFactory is set explicitly.

Link copied to clipboard

Send an SSH_MSG_IGNORE heartbeat every N milliseconds to keep the connection alive across NAT/VPN/firewall idle timeouts.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Quantize outbound keystroke packet timing to this interval (milliseconds) to mask inter-keystroke timing patterns. Requires a PTY session and server support for ping@openssh.com. Set to 0 to disable.

Link copied to clipboard
var port: Int

Port for TCP connections. Used with default KtorTcpTransport. Ignored if transportFactory is set explicitly.

Link copied to clipboard

When true, prefer password over keyboard-interactive when both are available. By default, keyboard-interactive is preferred.

Link copied to clipboard

Null preserves the historical authentication behavior for existing callers.

Link copied to clipboard

Re-key after this many wire bytes (sent or received). Default: 1 GB.

Link copied to clipboard

Re-key after this many milliseconds. Default: 1 hour.

Link copied to clipboard

Receive window, in bytes, for shells, commands and manually opened subsystems. SFTP channels opened by SshClient.openSftp use sftpWindowSize. A channel moves at most one window of data per network round trip, so a larger window speeds up bulk transfers on slower links. Each channel may buffer up to this much unread data. Default: 2 MiB. Reduce this for sessions with tighter memory limits.

Link copied to clipboard

Default response timeout for ordinary requests on clients opened by SshClient.openSftp. Defaults to 30 seconds; 0 waits until completion, disconnect, or coroutine cancellation. Excludes SFTP version negotiation and request writes. SftpClient.copyData uses its per-call timeout instead.

Link copied to clipboard

Receive window, in bytes, for channels opened by SshClient.openSftp. Default: 8 MiB, to sustain bulk downloads on higher-latency links. Each channel may buffer up to this much unread data; reduce this for tighter memory limits.

Link copied to clipboard

Custom transport factory. If not set, uses KtorTcpTransportFactory with host, port, and ipVersion.

Functions

Link copied to clipboard
Link copied to clipboard

Apply a freshly resolved SshCryptoPolicy before any explicit preference reordering. Resolve after installing platform crypto providers. The policy controls all algorithm categories, including public-key authentication, and enforces RSA/DH minimum key sizes. See SshCryptoPolicy for presets, custom expression syntax, and capability warnings.

Link copied to clipboard

Prepend certificate counterparts of configured host key algorithms at build time. Assignment order does not matter. Raw keys remain as fallback; CA trust must be configured in hostKeyVerifier. Calling with false disables automatic additions.