Skip to main content

Module ssh_utils

Module ssh_utils 

Source
Expand description

Platform-independent SSH utilities.

These utilities work on all platforms and don’t depend on openssh.

Structs§

CommandResult
Result of a remote command execution.
EnvPrefix
Environment variable prefix for remote command execution.

Functions§

build_env_prefix
Build a shell-safe environment variable prefix from an allowlist.
identities_only_args
-o IdentitiesOnly=yes for a system-ssh spawn that passes -i <identity_file>, but only when that file exists (bd-ebszo).
identity_shell_args
The -i <key> (plus identities_only_args) part of an ssh command line, shell-escaped, for rsync -e "ssh ..." transports (bd-ebszo).
is_retryable_transport_error
True if an SSH/transport error looks retryable (transient network / transport).
is_retryable_transport_error_text
Message-only variant of is_retryable_transport_error (useful for tests).
is_valid_env_key
Check if a string is a valid environment variable key.
shell_escape_path_with_home
Escape a path for use in a shell command, allowing ~ to expand to $HOME.
shell_escape_value
Escape a string for use in a shell command.