Connect to a remote server from Node.js, run a shell command, and capture its output without needing a native SSH client installed.
Build a Node.js SFTP client that uploads and downloads files from a remote machine over an encrypted SSH connection.
Create a custom SSH server in Node.js that handles authentication with passwords or key pairs and routes clients to specific handlers.
Set up SSH port forwarding in a Node.js app to securely tunnel traffic to a service on a remote server.
Requires Node.js 10.16+ (12+ for Ed25519 keys), the optional cpu-features addon improves cipher selection performance but is not required.
This is a Node.js library that lets JavaScript programs connect to remote servers over SSH, or act as an SSH server themselves. SSH is the standard protocol used to securely log into and run commands on remote computers. This library implements that protocol entirely in JavaScript without relying on any native system SSH installation. On the client side, the library can do everything a normal SSH client does. You can connect to a remote server, run a single command and get its output back, or open an interactive shell session. It also supports SFTP, which is the file transfer protocol that runs over SSH, letting you list directories, upload and download files on a remote machine. Port forwarding is supported in both directions: you can tunnel traffic from your local machine through the SSH connection to reach services on the remote server, or have the remote server forward traffic back to your local machine. There is also support for X11 forwarding (for graphical applications), SOCKS proxy connections, and using SSH tunnels as the underlying transport for regular HTTP or HTTPS requests. On the server side, the library lets you build a custom SSH server in Node.js. You can define how the server handles authentication, whether via password or SSH key pairs. The server can accept interactive shell connections, run specific commands sent by clients, and serve as an SFTP-only endpoint for file transfers. Installation is a single npm command. The library requires Node.js version 10.16.0 or newer. Support for Ed25519 key types requires version 12 or newer. An optional native addon called cpu-features can be installed alongside it to improve cipher selection performance, but it is not required. The library is tested against OpenSSH, the most widely deployed SSH implementation. The full README is longer than what was shown.
← mscdex on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.