Skip to main content

core.ssh.execute_command

Execute a command over SSH and return stdout, stderr, and exit status.

Secrets

Required secrets:
  • ssh: required values PRIVATE_KEY.

Inputs

string
required
Command to execute on the remote host.
string
required
SSH host to connect to.
string
required
SSH username.
array[integer] | null
Exit statuses treated as success when raise_on_error is enabled. Defaults to [0].Default: null.
array[string] | null
Text that marks the command as failed when raise_on_error is enabled. The action raises if stdout or stderr contains any item exactly as written: case-sensitive, and characters like *, . or ^ match themselves (no wildcards or regex). Example: ["Permission denied", "FATAL:"]. Up to 20 items, each 1-256 characters.Default: null.
boolean
Whether to verify the remote host key before connecting. Disable only for first-contact or otherwise trusted hosts; PID isolation and nsjail do not protect against SSH man-in-the-middle attacks.Default: true.
string | null
Expected public host key for the target host in ‘<key_type> <base64>’ format. Required when host_key_checking is enabled. For non-22 ports, the entry is stored as [host]:port.Default: null.
string | null
Password for the SSH user.Default: null.
integer
SSH port. Defaults to 22.Default: 22.
boolean
Raise an error when the exit status is not in allowed_exit_codes or the output contains any error_patterns. Defaults to returning the result.Default: false.
number
Timeout in seconds for connection and command execution.Default: 30.0.

Examples

Execute a remote command