DeepSeek Harness Plugin

sunChargedd/dsh-plugins#dsh-ssh-manage

Stars ★ 0 Downloads (30d) 6,275 Category Remote & Mobile Added 2026-10-29 npm dsh-ssh-manage

SSH host manager for DeepSeek Harness: browse ~/.ssh/config, store AES-256-GCM encrypted passwords, run batch commands and SFTP, and open interactive PTY terminals in persistent sidebar tabs.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-ssh-manage

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:sunChargedd/dsh-plugins#path:/dsh-ssh-manage

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

dsh-ssh-manage

Manage SSH hosts from the DSH sidebar and open a real interactive terminal.

中文 | English


What it is

dsh-ssh-manage is a Web plugin for DeepSeek Harness (DSH). It turns the hosts in ~/.ssh/config into manageable objects in the DSH sidebar:

  • Host management — scan the config, groups, tags, favorites, notes, latency, host inspection, one-click health checks, optional 5-minute scheduled checks with offline alerts, and per-host quick commands; SSH aliases are globally unique, so use the repeatable Display name for same names across groups;
  • DSH Agent integration — a compact host catalog is injected into the DSH system prompt; exec/batch/inspect/SFTP are directly callable; /ssh <alias> <command> runs from the composer and /ssh lists hosts; the Agent can also list/read/send/close the user’s open interactive PTY sessions via terminal_list/read/send/close;
  • Agent safety — Settings can enable read-only mode; dangerous actions can “ask before executing” through DSH approval; exec, batch commands, SFTP writes and host changes are written to a local audit log with password/token redaction;
  • Interactive terminal — ssh2 allocates a PTY, xterm.js renders it, with colors, arrow keys, full-screen programs such as vim/top, and window resizing;
  • Backup and migration — export/import hosts, groups, tags, notes, favorites and passwords from Settings; exports are re-encrypted with a passphrase (scrypt + AES-256-GCM) and imports merge by alias;
  • Port forwarding — start local 127.0.0.1:local → remote host:port tunnels or a local SOCKS5 proxy from host details, with ProxyJump/key auth, closed automatically when the plugin unloads;
  • Day-to-day operations — batch commands, SFTP browse/mkdir/rename/delete/upload/download/remote text editing, transfer queue with real upload progress and cancel, overwrite confirmation, connection tests;
  • Credentials — one AES-256-GCM encrypted password per host, never written to ~/.ssh/config; passwords are not returned to the browser by default, but Show password decrypts one on demand in the current page and auto-hides it after 30 seconds;
  • Agent tool — ssh_manager exposes the same capabilities to the model.

No more jumping between a terminal and DSH, and no need to remember where each host lives in the config file.

Features

Host management

  • Group tree on the left, host table on the right: search, filter by group, favorite, tags, notes, connection state and latency. Drag the divider to resize the group sidebar (double-click resets; the width is remembered).
  • Create, edit, rename and delete hosts; renaming migrates group, tags, favorites, notes, inspection data and the saved password.
  • Configurable table columns (info / notes / compact rows), responsive on narrow screens.
  • Host details drawer: address, user, port, group, tags, notes, distro, CPU, memory, disk, latency, plus "Test connection" and "Inspect".
  • Every write is backed up first, then written via a temp file and atomic rename; parse failures refuse the write instead of overwriting the config.
  • Only managed fields are updated (Host, HostName, User, Port, IdentityFile, ProxyJump, ForwardAgent); Include, LocalForward, comments, blank lines and extra aliases are preserved.

Interactive terminal

  • Click "Connect" to open a real PTY shell, not a one-command-at-a-time console.
  • Multiple hosts stay as tabs: switching to another DSH session and coming back re-attaches to the existing shell and replays roughly the last 256 KB of output; only closing the tab ends the session.
  • xterm.js 6.0.0 rendering with 256 colors, cursor, scrollback, selection copy, paste, resize, in-terminal search, font-size controls and a right-click copy/paste menu.
  • Terminal theme follows the DSH light/dark theme; the session bar has quick actions for address, password status, test, files, details, clear and close.
  • Output is streamed over a same-origin HTTP/SSE connection; input, resize and close use same-origin HTTP POST. A tested WebSocket channel is kept as a fallback.
  • Clear status and a "Reconnect" button when the backend is unavailable — no silent hang.

Batch commands and files

  • Batch commands — select hosts and run one command across them, with per-host stdout/stderr/exit code.
  • SFTP — browse remote directories, create folders, rename, delete files/empty directories, upload (multi-select and overwrite confirmation), download, and edit remote text files in place; the last directory per host is remembered.
  • Connection test — measures latency and writes it back to host metadata.
  • Host inspection — distro, CPU cores, memory and disk capacity.

Credentials and data

  • Passwords are AES-256-GCM encrypted in the plugin state directory and unlocked automatically at startup; no master password, no system Keychain.
  • Passwords are only used for SSH password authentication (also compatible with hosts that only offer keyboard-interactive). They are never written to ~/.ssh/config, command arguments or logs. They are not returned by default; Show password explicitly decrypts one into the current page for 30 seconds and it is never exposed through the Agent tool.
  • Ciphertext and key live in the same user directory, so this mainly protects against accidental file reads, not against malicious processes running as the same user.
  • Groups, tags, favorites, notes and inspection data live in hosts.json; passwords live in vault.json; configuration changes are snapshotted to the backup directory.

Host key verification: connections verify host keys against known_hosts (default ~/.ssh/known_hosts, override with SSH_KNOWN_HOSTS). The first connection to an unknown host, or a changed host key, is refused with the server SHA256: fingerprint, expected fingerprint and known_hosts path. Verify the fingerprint out of band; for a first connection the terminal error screen offers Trust host key and reconnect (with a second confirmation), or add the known_hosts line manually. A changed key is never auto-trusted; verify it and remove the old entry first. DSH_SSH_MANAGER_INSECURE_HOSTKEY=1 disables verification for emergency use only. Host certificates signed by a CA are not supported.

Agent tool

ssh_manager exposes: overview, list_hosts, save_host, delete_host, set_metadata, save_password, delete_password, test_connection, inspect_host, exec, batch_exec, sftp_list, sftp_upload, sftp_download, sftp_mkdir, sftp_rename, sftp_delete.

The password parameter is write-only; no response contains a plaintext password.

Misc

  • Light/dark themes, narrow layouts, all using DSH theme tokens.
  • Reads non-wildcard Host entries from ~/.ssh/config; Include and other directives are preserved verbatim (hosts defined inside Include are not expanded).
  • Every Host, PTY and static-asset route is gated by DSH connection.requestRejection; unauthenticated requests get 401.
  • No host or terminal data is sent to third-party services.

Usage

Sidebar → "SSH Hosts":

Tab Purpose
Hosts Group tree and host table; "Connect" opens a terminal, clicking a row opens the details/files drawer.
Sessions Open terminal tabs; switch, clear, reconnect, close.
Batch Select hosts, run one command and review aggregated output.
Settings Config path, backup directory, state directory, vault count, column preferences, compact rows.

Creating a host requires alias, hostname and password. The password is not written to ~/.ssh/config.

Installation

From npm (recommended)

npm package: dsh-ssh-manage (current version 0.3.25).

plugin_manager action=install_bundle target=dsh-ssh-manage@0.3.25

Or with the DSH CLI:

dsh plugin add dsh-ssh-manage@0.3.25

After installation, refresh the Web page; the sidebar shows an "SSH Hosts" entry with id dsh-ssh-manage.

Migrating from the old name dsh-ssh-manager: package name, plugin id and route prefix are now dsh-ssh-manage, but the state directory remains ~/.dsh/.ssh-manager/, so saved hosts, passwords and metadata are preserved.

Local development

Link the repository directory into the DSH profile; code changes apply immediately (Host-side changes still need a DSH restart):

plugin_manager action=install_bundle target=<repository>/dsh-ssh-manage

Manual

Add to the profile's cordis.patch.yml:

- insert:
    - id: dsh-ssh-manage
      name: 'dsh-ssh-manage'
      config: {}

and make sure the package is resolvable by the profile (for example link: to the local directory).

Compatibility

Requirement
DSH >=0.2.1-rc.3 <0.3.0 (validated on DSH Desktop 0.2.1-rc.3)
Node.js >=20 (follows the DSH runtime)
Platform Validated on macOS; the test suite only uses Node built-ins and runs cross-platform
Network Reachable SSH port (22 by default, or the configured port)
  • package.json declares engines.dsh; DSH checks compatibility before loading and refuses an incompatible version.
  • DSH extension points used: sidebar.panellist / main slots, ctx.locale, ctx.webServer.register, ctx.webServer.registerUpgrade, ctx.webServer.tapIndex, ctx.tools.register, connection.requestRejection.
  • The Host half checks that webServer.register exists and throws a clear error otherwise.
  • After installing or updating the plugin, the Host-side terminal routes (HTTP/SSE and the WebSocket fallback) and static-asset routes need a DSH restart; refreshing the page only updates browser code.

Architecture

┌───────────────────────── Browser ──────────────────────────┐
│  client.js                                                │
│  sidebar.panellist entry + main panel (hosts/sessions/    │
│  batch/settings), xterm.js terminal, React, ctx.slots      │
└─────────▲──────────────────────────────┬───────────────────┘
          │ GET /dsh-ssh-manage/state    │ POST /dsh-ssh-manage/action
          │ GET /dsh-ssh-manage/pty/events │ POST /pty/open|input|resize|close
          │ (SSE output)                 │ (input / resize / close)
┌─────────┴──────────────────────────────▼───────────────────┐
│  index.js (Host plugin)                                    │
│  routes · action dispatch · PTY sessions · assets · tool   │
└───────┬──────────────────────┬──────────────────────┬──────┘
        │                      │                      │
┌───────▼────────┐   ┌─────────▼────────┐   ┌─────────▼─────────┐
│ lib/ssh-client │   │ lib/ssh-config   │   │ lib/storage       │
│ ssh2: PTY,     │   │ parse / patch /  │   │ state / metadata /│
│ exec, SFTP     │   │ backup / atomic  │   │ vault / backups   │
└───────┬────────┘   └─────────┬────────┘   └─────────┬─────────┘
        │                      │                      │
   ~/.ssh/config         ~/.ssh/config         ~/.dsh/.ssh-manager/
File Responsibility
index.js Host plugin: HTTP/SSE/WS routes, action dispatch, PTY sessions, ssh_manager tool.
client.js Browser plugin: sidebar entry, management page, xterm terminal; only require('react').
lib/ssh-client.js ssh2 password / IdentityFile / ssh-agent auth, PTY, exec, SFTP, inspection.
lib/ssh-config.js ~/.ssh/config parsing, in-place editing, backups, atomic saves.
lib/storage.js / lib/vault.js / lib/metadata.js State directory, AES-256-GCM vault, host metadata.
lib/ws.js Dependency-free RFC6455 WebSocket server (fallback PTY channel).
assets/ Vendored xterm.js 6.0.0, @xterm/addon-fit 0.11.0 and MIT licenses.
scripts/test*.mjs Config/state/vault, WebSocket, PTY and SSE tests.

Data and security

  • Reads and writes only ~/.ssh/config, the plugin state directory (default ~/.dsh/.ssh-manager/, override with DSH_SSH_MANAGER_HOME) and the backup directory.
  • Configuration writes are backed up first and use a temp file + atomic rename; only managed fields change, other content is preserved.
  • vault.json uses AES-256-GCM with a key in the current user directory; hosts.json holds groups/tags/notes and other non-secret metadata.
  • All Host / PTY / static-asset routes require an authenticated DSH browser session; unauthenticated requests return 401.
  • Terminal traffic only flows between your browser and the target SSH host; no third-party service is involved.
  • Host keys are verified against ~/.ssh/known_hosts / SSH_KNOWN_HOSTS; unknown or changed keys are refused. This plugin only reads those files, not ssh_config UserKnownHostsFile/GlobalKnownHostsFile, and does not validate SSH CA host certificates — such hosts will be blocked until their key is added to the configured known_hosts file.

Development

Node.js >= 20. The only runtime dependency is ssh2; there is no build step.

cd dsh-ssh-manage
npm install
npm test
Command Description
npm run check Syntax checks + client model/i18n static guard
node scripts/test.mjs SSH config parse/write, backups, vault, metadata, tool arguments
node scripts/test-ws.mjs WebSocket handshake/framing/limits/strictness, PTY and asset routes
node scripts/test-pty.mjs WebSocket PTY end-to-end against a real ssh2 mock server
node scripts/test-sse.mjs HTTP/SSE PTY end-to-end against a real ssh2 mock server + 401 auth
npm test All of the above

The terminal uses vendored xterm.js 6.0.0 (MIT, see assets/LICENSE.xterm), @xterm/addon-fit 0.11.0 (MIT, see assets/LICENSE.addon-fit) and @xterm/addon-search 0.16.0 (MIT, see assets/LICENSE.addon-search).

Known limitations

  • Host key verification uses known_hosts; hosts with no matching entry are refused with a fingerprint and path hint. A first connection can be trusted from the terminal error screen after a second confirmation; changed keys require manual removal of the old entry. Custom UserKnownHostsFile/SSH CA setups still need manual handling.
  • Session lifetime: sessions are kept on the Host; switching to another DSH session, temporarily leaving the panel, or refreshing the page re-attaches to the existing shell and replays roughly the last 256 KB of output. The browser sends a /pty/touch heartbeat every 60s while the page is open; a session with no output, input or heartbeat for 30 minutes is reaped (max 16 sessions).
  • Authentication: saved passwords, IdentityFile private keys and SSH_AUTH_SOCK ssh-agent are supported; ~ is expanded in key paths. Passphrase-protected keys do not prompt for a passphrase yet — load them into ssh-agent.
  • ProxyJump: single-hop is supported using an existing host alias (reusing its password/key) or user@host:port (key/agent only); multi-hop is not supported yet. The jump host key must already be present in known_hosts.
  • Port forwarding: LocalForward, RemoteForward (binds 127.0.0.1 on the SSH server by default) and local SOCKS5 are supported. Tunnels live in the current Host process and close when the plugin or DSH exits.
  • Agent approval: requires the DSH approval service; dangerous operations fail closed when it is unavailable. Read-only mode still allows list/test/inspect/download.
  • Config editing scope: the editor only changes Host, HostName, User, Port and plugin metadata; maintain other SSH directives in ~/.ssh/config.
  • Batch commands run one command; they are not an interactive terminal. Per-host output is capped at 1 MB and marked truncated when exceeded.
  • File size: SFTP files are capped at 10 MB; remote text editing is capped at 1 MB.
  • Export safety: encrypted exports contain all passwords; a lost passphrase is unrecoverable. Import only merges and never deletes existing hosts or passwords.
  • SFTP rename/delete: rename refuses to overwrite an existing destination by default (sftp_rename can pass overwrite: true explicitly); deleting a directory requires it to be empty, and root paths, ./.. and drive roots are refused; symlinks are removed as links, not followed.
  • xterm assets: the first terminal open loads about 500 KB of xterm.js basics; the search addon loads on demand, about 556 KiB total from the same origin (no CDN).

Contributing

Issues and PRs are welcome, especially compatibility feedback for different SSH distributions and auth methods. Run npm test before submitting.

If this plugin helps you, a ⭐ Star is the best support.

License

MIT © 2026 Sun

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.