ssh feature. See SSH for client sessions, server endpoints, and file transfer workflows.
Managed inactivity timeouts take precedence over all timeout options below, including disabling the timeout. This applies to local and cloud sessions using the sandbox backend’s retained configuration.
Sandbox
sb.ssh()
Example
Example
connect or server.
Returns
SandboxSshOps
Returned by sb.ssh()
SSH operations for a sandbox.ssh.connect()
Example
Example
root, terminal from $TERM, SFTP enabled).
Returns
ssh.open_client()
connect.
Returns
ssh.connect_with()
Example
Example
Parameters
Returns
ssh.open_client_with()
connect_with.
Parameters
Returns
ssh.server()
Example
Example
SshServer is cloneable and can serve many connections.
Returns
ssh.prepare_server()
server.
Returns
ssh.server_with()
Example
Example
Parameters
Returns
ssh.prepare_server_with()
server_with.
Parameters
Returns
SshClient
Returned by ssh.connect(), ssh.connect_with()
Native in-process SSH client session.client.exec()
Example
Example
/bin/sh -c). No PTY is requested.
Parameters
commandimpl Into<String>Returns
client.exec_with()
Example
Example
tty; when a PTY is allocated, stderr is folded into stdout.
Parameters
commandimpl Into<String>Returns
client.attach()
Example
Example
Returns
client.attach_with()
Example
Example
Parameters
Returns
client.sftp()
Example
Example
sftp subsystem and returns a high-level SFTP session for reading, writing, and listing files inside the guest.
Returns
client.close()
Example
Example
SshServer
Returned by ssh.server(), ssh.server_with()
Reusable SSH server endpoint for a sandbox.server.serve()
Example
Example
Parameters
streamS: AsyncRead + AsyncWriteserver.serve_connection()
serve.
Parameters
streamS: AsyncRead + AsyncWriteSshStdioStream
Used by server.serve()
Ordered duplex stream backed by this process’s stdin and stdout. ImplementsAsyncRead and AsyncWrite.
SshStdioStream::new()
Example
Example
AsyncRead and AsyncWrite, so it can be passed straight to serve to bridge an SSH connection over the parent process’s standard streams. Also available via Default.
Returns
Constants
DEFAULT_SSH_HOST
DEFAULT_SSH_PORT
SshClientOptionsBuilder
Used by ssh.connect_with()
Builder for SSH client options. Defaults: userroot, terminal from $TERM (falling back to xterm), SFTP enabled, and the global SSH inactivity timeout.
client_options.user()
root.
client_options.term()
client_options.sftp()
true.
client_options.inactivity_timeout()
Duration::ZERO disables it.
client_options.disable_inactivity_timeout()
client_options.build()
SshExecOptionsBuilder
Used by client.exec_with()
Builder for SSH exec options.exec_options.tty()
false.
exec_options.build()
SshAttachOptionsBuilder
Used by client.attach_with()
Builder for interactive SSH attach options. Default terminal comes from$TERM (falling back to xterm); detach keys default to the standard sequence.
attach_options.term()
attach_options.detach_keys()
attach_options.build()
SshServerOptionsBuilder
Used by ssh.server_with()
Builder for SSH server options. SFTP is enabled by default; the inactivity timeout inherits the global SSH setting; when no authorized keys are provided, the default authorized-keys file is loaded.server_options.host_key_path()
server_options.host_key()
server_options.authorized_keys_path()
server_options.authorized_key()
server_options.user()
server_options.sftp()
true.
server_options.inactivity_timeout()
Duration::ZERO disables it.
server_options.disable_inactivity_timeout()
server_options.build()
SftpClient
Returned by client.sftp()
High-level SFTP client session.Types
SshOutput
Returned by client.exec(), client.exec_with()
Output from an SSH exec request.