ssh_conn_verify_sudo
Check if remote sudo or administrator elevation works before running privileged commands, detecting passwordless or password-based access to avoid failed tool calls.
Instructions
Check whether elevated access is available on the remote system, without running
any privileged command. Call this before using use_sudo=True on other tools if
you're not sure elevation will succeed.
On Linux/macOS: probes whether sudo is available and whether it needs a
password (via a passwordless sudo -n check, then a password-based check if
that fails). Tools called afterward with use_sudo=True will use whichever mode
this detected.
On Windows: there is no per-command elevation - checks whether the current SSH session itself is already running as Administrator. If it's not, no tool call can become elevated; you must reconnect as an Administrator account instead.
Returns:
Dictionary with:
- available (bool): True if sudo/elevation can be used at all (passwordless
OR password-based on Linux/macOS; same as passwordless on Windows, since
there's no separate password-based mode there)
- passwordless (bool): True if no password is needed (passwordless sudo, or
an already-elevated Windows session)
- requires_password (bool): True if sudo works but needs a password (always
False on Windows)
Long-running calls: if this takes longer than the server's wait cap (default 50s), it
returns {"status": "in_progress", "handle_id": ...} instead of the result - the work keeps
running. Get the result by polling ssh_cmd_check_status(handle_id=...), which returns this
tool's normal response once finished. Do not call it again meanwhile. Only one such
operation runs at a time; another one started meanwhile fails with a 'busy' error.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||