ssh_execute
Execute remote commands via SSH, returning output, with automatic support for ssh-agent, ProxyCommand, and ~/.ssh/config.
Instructions
Execute a command on a remote server via SSH and return the output. Uses the system SSH binary so ssh-agent, ProxyCommand, and ~/.ssh/config are honoured automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | SSH server hostname or IP address (e.g., 'dev234' or '192.168.1.100') | |
| port | No | SSH server port (default: 22) | |
| username | No | SSH username (e.g., 'username'). Defaults to the current OS user. | |
| command | Yes | Command to execute on the remote server | |
| timeout | No | Command timeout in milliseconds (default: 30000) | |
| agentForward | No | Enable SSH agent forwarding (default: false) | |
| extraArgs | No | Extra SSH arguments (e.g., ['-o', 'StrictHostKeyChecking=no']) |