shelljs-plugin-ssh

1.2.2 • Public • Published

shelljs-plugin-ssh

shelljs-plugin

A ssh plugin for shelljs.

Install

npm i shelljs-plugin-ssh

Usage

  • Execute a command on a remote host : ssh(HOST, command, opts)
  • Open a live shell on a remote host : ssh(HOST, opts)

Options

  • host - string - Hostname or IP address of the server.
  • port - integer - Port number of the server. Default: 22
  • username - string - Username for authentication.
  • password - string - Password for password-based user authentication.
  • privateKey - mixed - Buffer or string that contains a private key for either key-based or hostbased user authentication (OpenSSH format).
  • passphrase - string - For an encrypted private key, this is the passphrase used to decrypt it.

See ssh2 client config options for more.

Examples

require('shelljs-plugin-ssh');
 
const HOST = 'junk@localhost';
 
// Exec command over ssh
const { out, error } = ssh(HOST, 'ls -l');
 
// Enable interactive password input
const { out, error } = ssh(HOST, 'ls -l', {
    promptPassword : true
});
 
// Setup a live shell on remote host
ssh(HOST);
 
// Enable interactive password input
ssh(HOST, {
    promptPassword : true
});

Readme

Keywords

Package Sidebar

Install

npm i shelljs-plugin-ssh

Weekly Downloads

12

Version

1.2.2

License

MIT

Unpacked Size

4.46 kB

Total Files

6

Last publish

Collaborators

  • matthieulemoine