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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>",
"command": "<command>"
},
"name": "ssh_sudo_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| command | Yes | ||
| sudo_password | No | ||
| timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||