READMESource: main@f500094d
dsh-plugin-ssh-manager
Manage DSH instances running on multiple machines (multi-IP) from a single DSH terminal, connected through SSH tunnels. 在一台终端上通过 SSH 隧道管理多台机器(多 IP)上的 DSH。
- Each configured remote host gets an
ssh -N -Ltunnel from this machine to the remote DSH web server (127.0.0.1:<remotePort>on the remote side). - Every host is assigned a stable local port (
21300–21399by default, or a port you pin), so the remote console is always reachable athttp://127.0.0.1:<localPort>. - Hosts can auto-connect on startup and auto-reconnect with backoff.
- Two surfaces: a sidebar quick menu (远程 DSH) that lists hosts and opens the remote console in one click, and a full management page under Settings → SSH 隧道主机 (add / edit / delete / connect / disconnect).
- A model tool
ssh_manageris registered too, so the agent itself canlist / status / connect / disconnect / opentunnels on request.
Install / 安装
Install into a dsh profile (the profile this app runs, usually web):
dsh plugin --profile web add github:ljh220300-eng/dsh-plugin-ssh-manager
or with plain pnpm inside the profile directory:
pnpm -w add github:ljh220300-eng/dsh-plugin-ssh-manager
For local development use a path spec instead
(dsh plugin --profile web add file:F:/work/dsh-plugin-ssh-manager).
After installing, restart the app (host half loads at boot) and refresh the
page (client half). The dsh plugin command reconciles the
dsh.profile.bundles layer list for you automatically.
Authentication / 认证
- Key (推荐 / recommended) —
ssh-agent(default) or an explicit identity file. Requires the key on the ssh agent or at the given path; first use of a remote host auto-accepts its host key (StrictHostKeyChecking=accept-new). In the settings form, 选择文件 / Choose file imports a private key straight from your file system — the content is uploaded to the local plugin store ($DSH_HOME/plugins/ssh-manager/keys/, one file per unique key content, mode 0600) and the path field is filled for you; the file is removed again when its last host is deleted. Typing a host-side path manually still works. - Password (密码) — supported through an
SSH_ASKPASSwrapper that the plugin generates next to its config; the password is stored in$DSH_HOME/plugins/ssh-manager/hosts.json(file mode 0600) and passed to ssh via environment only — it never appears in process command lines. OpenSSH ≥ 8.4 (SSH_ASKPASS_REQUIRE) is required; on older clients switch to key auth.
Configuration / 配置
- Registry:
$DSH_HOME/plugins/ssh-manager/hosts.json(~/.dsh/plugins/ssh-manager/hosts.jsonunlessDSH_HOMEis set). - One record per remote host:
{
"name": "lab-01",
"sshHost": "192.168.1.10",
"sshPort": 22,
"sshUser": "root",
"authMethod": "key",
"identityFile": "C:\\Users\\me\\.ssh\\id_ed25519",
"passphrase": "",
"remoteHost": "127.0.0.1",
"remotePort": 3080,
"localPort": null,
"autoConnect": true
}
remotePortis the port the remote DSH web server listens on (dsh webdefaults to 3080; the desktop app picks its own — check the remote machine's GUI URL).remoteHostis the bind address to reach on the remote side through ssh; keep127.0.0.1when DSH runs on the ssh host itself.- Passphrase-protected keys are supported:
passphraseis answered through the same SSH_ASKPASS mechanism as passwords (environment only).
Requirements / 依赖
- An OpenSSH client (
ssh) on this machine — Windows ships it as an optional feature (设置 → 可选功能 → OpenSSH 客户端); the plugin also probesC:\Windows\System32\OpenSSH\ssh.exeand/usr/bin/ssh. - No additional npm dependencies; it runs against the packages the dsh
profile already provides (
@deepseek-ai/dsh-tools,@deepseek-ai/dsh-home-paths).
License
MIT
No comments yet. Be the first to write one.