ssh_exec
Execute remote commands over SSH using private key or password authentication, returning stdout, stderr, and exit code.
Instructions
Run a command on a remote host over SSH, fully in-process (no ssh.exe, no WSL — works headless). Use for Linux hosts or any OpenSSH target. Auth via privateKeyPath or password. Returns stdout, stderr, exit code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Remote host or IP. | |
| port | No | SSH port (default 22). | |
| tail | No | Keep the LAST maxOutputBytes instead of the first (tail) — useful for long logs. | |
| command | Yes | Command to run on the remote host. | |
| password | No | Password auth (used if no key). | |
| username | Yes | SSH username. | |
| timeoutMs | No | Hard timeout in ms (default 60000). Also bounds the connection handshake. | |
| passphrase | No | Passphrase for the private key, if any. | |
| maxOutputBytes | No | Cap captured stdout/stderr per stream (bytes, default 1 MiB). | |
| privateKeyPath | No | Path to a private key file on this Windows host, e.g. C:\\Users\\isak\\.ssh\\id_ed25519. |