> This page is for Remediation Orchestrator.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/remediation-orchestrator/llms.txt.

# ssh

**Experimental.** For evaluation. Interfaces, configuration, and behavior may change incompatibly.

Executes remote commands and transfers files through native SSH or Teleport.

### Prerequisites

* Reachable SSH hosts and an authorized login. For managed Bash commands, the login user must belong to `group_name` on each target host. The default is `maestro-svc-users` and the group must already exist.
* Worker-readable private key and trusted `known_hosts` file.

### Setup

* Configure native SSH:

```toml
[modules.ssh]
user = "automation"
use_teleport = false
use_teleport_direct = false

[modules.ssh.client_options.default]
identity_file = "/etc/ssh/automation_key"
known_hosts_file = "/etc/ssh/known_hosts"
```

* Create `maestro-svc-users` and add the login user, or set `group_name` to an existing group the user belongs to.

> **Note**
>
> This module must be enabled in your Remediation Orchestrator config before it is available to scripts.

This module provides functionality for executing commands over SSH. It supports authentication via ssh-agent, private key (with optional passphrase), or password. Host key verification can be done using a known_hosts file or disabled (not recommended for untrusted networks).

## Members

* [bash](#bash)
* [execute](#execute)
* [write_file](#write_file)

## bash

Execute a bash script (one-liner or multi-line) over SSH on the specified node. The script is passed via stdin to 'bash -s'. Returns an ExecuteResult.

The target host (hostname or IP address) to execute the script on.

The Bash script string to execute.

The cluster ID of the target host.

A dict of environment variables (string:string) to set for the script.

The connection strategy to use for the SSH connection. Either 'native' or 'teleport'. If not provided, the strategy is determined by modules.ssh.use_teleport, falling back to the 'ssh_use_teleport' feature flag when the setting is absent. Set this explicitly when a workflow needs to override that default.

The name of the client options to use for the SSH connection. If not provided, the default client options are used.

Timeout duration as a string (e.g. '2m', '30s', '1h'). If not provided, no user timeout is applied. Instead, Temporal will timeout the activity based on the default timeout policy.

If true, only kill the wrapper processes (nohup, sg, sh, bash) on timeout, leaving spawned descendant processes running. If false (default), kill all descendants.

Optional node-registry identity used to resolve the transport host.

An ExecuteResult object containing stdout, stderr, and exit_code.

## execute

Execute a command over SSH on the specified host. Returns an ExecuteResult.

The target host (hostname or IP address) for the SSH command.

The command string to execute.

The cluster ID of the target host.

A dict of environment variables (string:string) to set for the command.

Optional string content to pass to the command's standard input.

Optional node-registry identity used to resolve the transport host.

Optional per-call Temporal activity budget such as 31m. Both start-to-close and schedule-to-close use this value.

Optional maximum Temporal activity attempts. Zero preserves the SSH module default; one disables retries.

An ExecuteResult object containing stdout, stderr, and exit_code.

## write_file

Write a file to a remote host via SFTP. Creates parent directories if needed.

The target host (hostname or IP address) to write the file to.

The destination path on the remote host.

The File object to transfer.

The cluster ID of the target host.

Number of bytes written to the remote file.