hcyinnn/dsh-tool-ssh0

dsh-tool-ssh

面向模型的 SSH 工具插件,允许 DSH Agent 通过 OpenSSH 在远程主机上执行命令及传输文件。

AI 分析

赋予 Agent 远程服务器运维能力。适合需要让 AI 自动执行远程 Linux 命令、部署应用或传输文件的系统管理员和开发者。

包名
dsh-tool-ssh
版本
0.1.0
许可证
MIT
最近更新
2026年9月1日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hcyinnn/dsh-tool-ssh

配置

在 profile 的 cordis.patch.yml(或 bundle patch 覆盖)中配置:

- id: tool-ssh
  name: 'dsh-tool-ssh'
  config:
    # 命名主机:Agent 可以直接用别名引用
    hosts:
      prod-web:
        host: 10.0.0.5
        user: deploy
        port: 22
        identityFile: ~/.ssh/deploy_key
      db:
        host: db.internal
        user: root
    # 单次命令默认超时(毫秒),默认 30000
    defaultTimeoutMs: 30000
    # 连接超时(毫秒),默认 15000
    connectTimeoutMs: 15000
    # ssh / scp 二进制路径,默认取 PATH 中的 ssh / scp
    sshBinary: ssh
    scpBinary: scp
    # -o BatchMode=yes:失败即停,不弹密码/主机密钥交互,默认 true
    batchMode: true

安全建议:不要在配置里写死密码;插件默认启用 BatchMode=yes(避免在无人值守时挂起), 认证请使用密钥。各部署允许访问哪些主机、是否允许上传等策略,属于部署策略, 建议用 tools/pre-execute / ctx.tools.guard() 在外部实现,而不是写进本插件。