waft.system.clients.ssh_client module

SSH client for remote command execution and file transfer.

class waft.system.clients.ssh_client.SshClient(connection_details: ConnectionDetails)

Bases: ClientBase

SSH client for executing commands and transferring files on remote systems.

bind_remote_port_to_local(remote_port: int, local_port: int | None = None, remote_host: str = '127.0.0.1', local_host: str = '127.0.0.1') Generator[int, Any, None]

Forward a remote port to localhost.

property connection: Connection

Get the SSH connection.

exec_command(command: list, input: str | list[str] | None = None, retry_handler: RetryHandler | None = None, expected_exit_code: int | None = 0, auto_raise: bool = True, custom_exception: Type[Exception] | None = None, custom_exception_msg: str | None = None, **kwargs) Result

Execute a command on the remote system.

get_file(remote_file_path: PurePath, local_file_path: Path) None

Download a file from the remote server.

property is_unix: bool

Check if remote system is Unix-like.

reset_connection() None

Close and clear cached connections to force reconnection on next use.

send_file(remote_file_path: PurePath, local_file_path: Path) None

Upload a file to the remote server.

test_connection() bool

Test SSH connection with fallback to password auth.