ssh_exec
Run a shell command on a remote host over an existing SSH session and get its stdout, stderr, and exit code. Use absolute paths or chained commands for multi-step tasks, since each call starts a fresh shell.
Instructions
Run a shell command on the remote host over an existing session and
return its stdout, stderr, and exit code. Output is truncated if very
large. Not a persistent shell — each call is a fresh exec_command, so
cd and env vars set in one call don't carry to the next (chain with
&& or use absolute paths / a wrapper script for multi-step sequences).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| timeout | No | ||
| session_id | Yes |