Skip to content

Ssh2shell 4.0.3

Choose a tag to compare

@cmp-202 cmp-202 released this 18 Nov 03:41
· 32 commits to master since this release
8199e95

4.0.3 — Correctness fixes for PTY handling, credential redaction, host validation, and run shutdown, plus hardened release and live-test workflows. Patch release; existing 4.0.x usage is unaffected.

Fixed

  • A host object without server now reports an error of type Parameters (primary) or Hop (nested) instead of throwing a TypeError before the connection starts.
  • verbose: true now redacts privateKey in the config dump, alongside password and passphrase. exposeCredentials: true still shows it.
  • pty: false now disables the pseudo-terminal. It was previously ignored because ssh2 takes the PTY request from the first shell() argument.
  • stop() and close({ graceful: true }) no longer empty the caller's nested hosts arrays; the run's own queue is cleared instead, so a host config can be reused.
  • stop() is now a no-op after a run that ended on a failure, and abortOnSudoFailure finishes as soon as the interrupted shell returns to a prompt instead of waiting out the idle timeout.
  • A second connect() now throws instead of calling back with an empty string. Each SSH2Shell instance runs once; construct a new one to run again.

Development

  • publish.yml passes the release ref through env: EXPECTED_REF instead of shell interpolation, so a crafted tag name cannot inject commands.
  • live.yml skips the live job for fork pull requests while still running it for same-repo pull requests, pushes, schedules, and workflow_call.
  • Added unit coverage for stop-after-failure, sudo prompt return, and instance reuse.

Install

npm install ssh2shell@4.0.3

Links