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

command
string
required
Command to execute on the remote host.
host
string
required
SSH host to connect to.
host_public_key
string
required
Expected public host key for the target host in ‘<key_type> <base64>’ format. For non-22 ports, the entry is stored as [host]:port.
username
string
required
SSH username.
password
string | null
Password for the SSH user.Default: null.
port
integer
SSH port. Defaults to 22.Default: 22.
timeout_seconds
number
Timeout in seconds for connection and command execution.Default: 30.0.

Examples

Execute a remote command
- ref: collect_uptime
  action: core.ssh.execute_command
  args:
    host: 10.0.10.15
    port: 22
    username: tracecat
    host_public_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBEXAMPLEHOSTKEY"
    command: uptime
    timeout_seconds: 20