ssh2-client
A Promise based wrapper around ssh2 to exec commands or setup a live shell on a remote host.
Install
npm i ssh2-client
Usage
- Execute a command on a remote host :
ssh.exec(HOST, command, options)
- Open a live shell on a remote host :
ssh.shell(HOST, options)
options
is optional. options.ssh2
is forwarded to ssh2.
Examples
const ssh = ; const HOST = 'junk@localhost'; // Exec commands on remote host over sshssh ; // Setup a live shell on remote hostssh ; // Enable interactive password prompt// askPassword option is only needed for the first commandconst opts = askPassword: true; ssh ;