pub struct SshOptions {
pub connect_timeout: Duration,
pub command_timeout: Duration,
pub server_alive_interval: Option<Duration>,
pub control_persist_idle: Option<Duration>,
pub control_master: bool,
pub known_hosts: KnownHostsPolicy,
}Expand description
SSH connection options.
Fields§
§connect_timeout: DurationWall-clock deadline for connection setup, including authentication and ControlMaster readiness. A mux fallback shares the same deadline.
command_timeout: DurationCommand execution timeout.
server_alive_interval: Option<Duration>Server keepalive interval (ssh -o ServerAliveInterval).
Defaults to None (OpenSSH default; keepalive disabled).
control_persist_idle: Option<Duration>How long the SSH ControlMaster should remain alive while idle.
Only applies when control_master is true (connection reuse). Some(n)
with n > 0 keeps the master warm for n idle seconds. Active commands
prevent expiry. Some(0s)/None, or a non-mux per-call session, keeps
the master only for this client’s lifetime. RCH owns this idle timer:
OpenSSH’s ControlPersist forks an unowned process even without -f,
so the SSH child always uses ControlPersist=no.
control_master: boolSSH control master mode for connection reuse.
known_hosts: KnownHostsPolicyKnown hosts policy.