ssh_open
Open or reuse a persistent SSH session to a Linux device with selectable permission modes; subsequent command execution keeps the working directory and environment.
Instructions
打开(或复用)一台设备的持久 SSH 会话。模式:1=只读命令;2=只允许在 root 目录内修改;3=全部允许但 sudo 需要用户手动 unlock;4=完全权限(sudo 密码自动输入)。一次 open 之后用 ssh_exec 即可,cwd/env 会保持。
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": {
"host": "<host>",
"user": "<user>",
"mode": "<mode>"
},
"name": "ssh_open"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | IP 或主机名,例如 192.0.2.10 | |
| mode | Yes | 权限模式 | |
| port | No | SSH 端口,默认 22 | |
| root | No | 模式2 的工作目录,默认远端 HOME | |
| user | Yes | SSH 用户名 | |
| session | No | 会话名,默认由 host 生成 | |
| identity | No | SSH 私钥路径(可选) | |
| password | No | SSH 密码(通常不用传,密码已保存在本地 vault) |