> ## Documentation Index
> Fetch the complete documentation index at: https://docs.machine0.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SSH Exec

> Execute commands on VMs remotely via MCP.

## ssh\_exec

Run a command on a VM via SSH. Returns stdout, stderr, and exit code. No interactive commands or stdin.

| Parameter      | Type    | Required | Description                                           |
| -------------- | ------- | -------- | ----------------------------------------------------- |
| `machine_id`   | UUID    | no       | VM ID (provide one of `machine_id` or `machine_name`) |
| `machine_name` | string  | no       | VM name                                               |
| `command`      | string  | yes      | Shell command (max 65,536 chars)                      |
| `timeout`      | integer | no       | Seconds (default: 30, max: 300)                       |
| `username`     | string  | no       | SSH username override                                 |

Requires a managed SSH key. VMs created with public keys will fail. If you need to switch, destroy the VM and recreate it with a managed key ID in `sshKeyId`.
