ssh_sudo_execute
Execute shell commands with sudo on a remote host using an existing SSH session, with optional sudo password for elevated privileges.
Instructions
Execute a command with sudo on the remote host. If the user already has passwordless sudo, leave sudo_password empty.
Args: session_id: The session ID returned by ssh_connect. command: Shell command to execute under sudo. sudo_password: Password for sudo prompt (empty for passwordless sudo). timeout: Maximum seconds to wait (default: 120).
Returns: Dict with stdout, stderr, and exit_code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| command | Yes | ||
| sudo_password | No | ||
| timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||