Skip to content

DSH Remote Console 0.7.0 — file transfer & port forwarding

Choose a tag to compare

@cccodder cccodder released this 28 Oct 03:00
737d4e3

File transfer and port forwarding, both riding the SSH session you already logged in to. The agent can now move files and open tunnels without a second authentication and without the plugin ever seeing a password.

Added

  • remote_upload / remote_download: streamed over the authenticated ControlMaster socket, sha256 compared on both sides, no overwrite unless overwrite: true, 256 MB per file. Downloads go to a temporary file and are renamed only after the hash check, so a failed transfer cannot destroy an existing local file.
  • remote_read_file / remote_write_file: read and write small remote text files (128 KB read default, 256 KB write cap). The content travels over stdin/exec, so it never shows up in the user's terminal; binary files are refused instead of being dumped as text.
  • remote_forward: start / stop / list for ssh -N -L 127.0.0.1:<local>:<remote_host>:<remote_port>, bound to loopback only. Tunnels are cancelled when the terminal ends, remote_close runs, or the plugin unloads.
  • Approval for sensitive writes: ~/.ssh, /etc, /root, /boot, sudoers, systemd units and shell profiles go through ctx.approval; without an approval service the write fails closed. Paths containing .. are rejected.
  • Real-sshd integration tests (tests/sshd-harness.mjs + tests/integration-sshd.test.mjs): throwaway sshd on 127.0.0.1 covering wrapper login, master reuse, 1 MB upload/download with sha256, port forwarding, exit-code passthrough. They skip cleanly when ssh/sshd are missing. CI runs them.
  • docs/compat.md compatibility matrix; README troubleshooting section (zh/en, 7 symptoms); tool table updated to 11 tools.
  • scripts/bench.mjs SSH-channel baseline. Loopback environment (6 vCPU, OpenSSH 9.2p1): master setup ~190 ms, exec round-trip p50 ~12 ms / p95 ~13 ms, 1 MiB upload ~37 MiB/s, download ~23 MiB/s.

Changed

  • engines.dsh tightened to >=0.2.1-rc.2 <0.3.0-0, so 0.3.0-rc.* is no longer silently accepted.
  • DSH_SSH_CONFIG now applies to the exec, transfer and forwarding channels as well as the terminal wrapper, so a host can never resolve differently between the two.

Fixed

  • Stopping a port forward under multiplexing: with -S pointing at an existing master, the ssh -N -L client can exit before or while the forward lives on the master (OpenSSH 9.6 even exits 1 after installing it). remote_forward decides success by whether the port listens and stops tunnels with ssh -O cancel.

Install / update