@zero-transfer/ssh
v0.4.7
Published
Zero-dependency SSH 2.0 transport, auth, and channel primitives.
Maintainers
Readme
@zero-transfer/ssh
Zero-dependency SSH 2.0 transport, auth, and channel primitives.
Install
npm install @zero-transfer/sshOverview
Standalone, zero-dependency SSH 2.0 stack - RFC 4253 transport (curve25519-sha256 KEX, AES-CTR + HMAC-SHA2), RFC 4252 user authentication (password, keyboard-interactive, publickey for Ed25519 / RSA-SHA2-256/512), RFC 5656 ECDSA host keys (P-256/384/521), RFC 4254 channels, OpenSSH known_hosts parsing, and host-key pinning. The same protocol stack that powers the SFTP provider, exposed for callers that need direct SSH features (custom subsystems, exec channels, port forwarding, custom RPC) - capabilities the Node.js ecosystem otherwise lacks a maintained pure-JS solution for.
Usage
import {
SshTransportConnection,
SshTransportConnectionOptions,
SshTransportHandshake,
} from "@zero-transfer/ssh";Public surface
This package publishes a narrowed surface of 26 exports. These symbols are also available from @zero-transfer/sdk; the table below links into the full API reference:
| Symbol | Kind | Notes |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------------------ |
| SshTransportConnection | Class | See API reference. |
| SshTransportConnectionOptions | Interface | See API reference. |
| SshTransportHandshake | Class | See API reference. |
| SshTransportHandshakeResult | Interface | See API reference. |
| SshDisconnectReason | Type | See API reference. |
| SshAlgorithmPreferences | Interface | See API reference. |
| NegotiatedSshAlgorithms | Interface | See API reference. |
| DEFAULT_SSH_ALGORITHM_PREFERENCES | Variable | See API reference. |
| negotiateSshAlgorithms | Function | See API reference. |
| SshAuthSession | Class | See API reference. |
| SshPasswordCredential | Interface | See API reference. |
| SshPublickeyCredential | Interface | See API reference. |
| SshKeyboardInteractiveCredential | Interface | See API reference. |
| buildPublickeyCredential | Function | See API reference. |
| SshConnectionManager | Class | See API reference. |
| SshSessionChannel | Class | See API reference. |
| SshDataReader | Class | See API reference. |
| SshDataWriter | Class | See API reference. |
| parseKnownHosts | Function | See API reference. |
| matchKnownHosts | Function | See API reference. |
| matchKnownHostsEntry | Function | See API reference. |
| KnownHostsEntry | Interface | See API reference. |
| KnownHostsMarker | Type | See API reference. |
| runSshCommand | Function | See API reference. |
| RunSshCommandOptions | Interface | See API reference. |
| RunSshCommandResult | Interface | See API reference. |
Examples
| Example | What it shows |
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| examples/ssh-exec-command.ts | SSH remote command execution via the standalone @zero-transfer/ssh stack. |
| examples/sftp-private-key.ts | SFTP private-key authentication example with host-key pinning. |
Documentation
License
MIT © Tony Wiedman
