DeepSeek Harness SCP Upload/Download Tool: dsh-scp-ops

Preface

Working with remote files in DeepSeek Harness (DSH) has traditionally required manually typing scp commands in the terminal: authentication, path handling, and transfer verification all had to be managed by hand, with no unified entry point at the plugin layer. Moreover, many embedded devices or vendor firmware do not provide an SFTP subsystem, making existing ssh2 libraries unable to use the SFTP channel directly.

dsh-scp-ops is designed specifically for DSH. It implements the SCP wire protocol over ssh2’s exec channel, requiring only an scp executable on the remote side—no SFTP subsystem needed.

What It Is

dsh-scp-ops is an SCP upload/download plugin for DeepSeek Harness, maintained by ciskonc. It performs file transfers over ssh2’s exec channel using the scp -t (upload) and scp -f (download) wire protocol, ensuring compatibility with older devices that lack an SFTP subsystem.

Once installed, two new tools are added to the session: scp_upload and scp_download, supporting single-file, recursive directory, and wildcard batch transfers, with bidirectional mtime/atime preservation and legacy device compatibility.

Core Features

  • Two transfer tools: scp_upload (local→remote) and scp_download (remote→local).
  • Transfer modes: Supports single file, recursive directory, and wildcard batch.
  • Parameters: recursive for directory recursion, preserve for bidirectional timestamp retention, literal (wildcards treated literally during download).
  • Legacy device compatibility: Named profiles define algorithms (e.g., KEX and cipher) and try_keyboard (automatic keyboard-interactive responses).
  • Path & verification: Upload destination semantics align with OpenSSH scp; download performs containment checks, rejects .//.., controls symlink access, caps directory entries at 20,000, and limits single files to 4 GiB.
  • Streaming transfer: Transfers are streamed with constant memory in both directions, with byte-count verification.

Installation & Enablement

Install from npm:

dsh plugin --profile web add dsh-scp-ops

ssh2 is a lazily resolved dependency and is not listed in dependencies: if dsh-ssh-ops is already present in the same profile, it is automatically satisfied; otherwise add it manually:

dsh plugin --profile <name> add ssh2

When installing ssh2 manually via pnpm, you may encounter ERR_PNPM_IGNORED_BUILDS with exit code 1; in this case the package is actually installed and usable—the signal is misleading.

Build from source:

git clone https://github.com/ciskonc/dsh-scp-ops.git

(ssh2 dependency handling is the same as above)

Named Profile Example

Named profiles are defined in the config.profiles list at the patch layer:

- id: scp-ops
  name: 'dsh-scp-ops'
  config:
    profiles:
      - name: legacy-nas
        host: 192.168.1.10
        username: admin
        password: 'app-password'
        algorithms:
          kex: [diffie-hellman-group14-sha1]
          cipher: [aes128-cbc]
        try_keyboard: true

When a profile is matched, the endpoint is locked: inline host/port/username that conflict with the profile will be rejected; only authentication material (password/private_key/passphrase) may be supplemented inline.

Legacy device compatibility is handled via profile-level algorithms (e.g., SHA1 KEX, CBC ciphers) and try_keyboard.

General Parameters

Parameter Description
profile or inline host/port/username/password/private_key/passphrase Connection source; endpoint is locked when a profile matches, see previous section
recursive Recursive directory transfer (scp -r)
preserve Bidirectional mtime/atime preservation (scp -p; T frames round-trip in OpenSSH four-field format)
literal Download only: wildcards are treated as literal names (POSIX remote escapes glob metacharacters before sending, bypassing the remote scp’s own glob)
remote_shell posix / win: remote shell quoting style; auto-detected by default based on remote path form (drive-letter/UNC paths treated as Windows); for Windows remote relative paths, explicit specification is recommended
timeout_ms Range [5000, 3600000], default 10 minutes; values below 5000 are raised to 5000, values above 3600000 are clamped to the upper limit
algorithms Inline override of SSH algorithms (kex, cipher) for legacy devices; typically defined in a profile
try_keyboard Auto-respond to keyboard-interactive authentication prompts; typically defined in a profile

Typical Usage

Upload a file to the remote:

dsh scp_upload --profile legacy-nas /local/file.txt /remote/path/

Recursively upload a directory:

dsh scp_upload --profile legacy-nas --recursive /local/dir/ /remote/dir/

Download a remote file to local:

dsh scp_download --profile legacy-nas /remote/path/file.txt /local/path/

Recursively download a directory:

dsh scp_download --profile legacy-nas --recursive /remote/logs/ /local/logs/

Download with literal wildcard handling:

dsh scp_download --profile legacy-nas --recursive --literal /remote/logs/*.log /local/logs/

Specify remote shell quoting style (Windows remote relative path):

dsh scp_download --profile legacy-nas --recursive --remote-shell win /remote/logs/ /local/logs/

Use Cases & Caveats

  • Suitable for scenarios requiring unified management of remote file upload/download in DSH, where the remote environment does not support or provide an SFTP subsystem.
  • Legacy device compatibility: adapted via profile-level algorithms and try_keyboard.
  • Transfer parameters: Transfers on the same host are serialized by default (max_concurrent_per_host defaults to 1); parallelism requires raising this value, but two uploads targeting the same remote destination constitutes a caller input conflict with undefined results.
  • Caveats:
  • No resumable transfer.
  • If a transfer fails mid-way, already-transferred files are retained; no rollback is performed.
  • No SSH host key verification (TOFU—trust on first use).
  • Wildcard download relies on the remote scp supporting the -- separator.
  • local_path must be an absolute path.
  • A recursive upload of a purely empty directory tree will create all empty directories on the remote (files=0 does not mean “nothing was transferred”).
  • When credentials are omitted, the last successful connection credentials for the same host|port|username within the current process are reused (credentials_reused: true); the cache is cleared when the plugin is disabled or the host restarts—if the remote password has changed, explicitly pass password.
  • When the remote is Windows, be aware of automatic path quoting adaptation, drive-letter path support, possible garbled display of non-ASCII filenames (byte names can be read directly via PowerShell), and negotiation overhead with manual troubleshooting hints.

The plugin is provided as a host-only bundle: it registers host tools and patch config, with no client-side components.

Closing

dsh-scp-ops fills the gap for SCP wire protocol file transfer in DSH, enabling unified plugin-level usage even on legacy devices and environments without an SFTP subsystem. See the project repository for implementation details and changelog.

  • Project directory: https://www.skillhub.cn/plugins/ciskonc/dsh-scp-ops
  • GitHub: https://github.com/ciskonc/dsh-scp-ops
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye