Skip to content

kingcritter/node-red-contrib-ssh-v2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-red-contrib-ssh-v2

Available on NPM as node-red-contrib-ssh-v2-reconnection. Based on node-red-contrib-ssh which does not seem to be maintained. The original lacked the ability to reconnect to the SSH server, limiting its usability.

Improvements from the original

  • fix unusable ssh key config
  • support reconnecting when node receives input
  • put output in the payload field
  • accept settings as input

Usage

Input: msg.payload can either be a string, in which case it's interpreted as the command to execute, or it can be a JSON object with a command field and any options you want to specify. Options set on the node itself, using the GUI, will take precedence over any that are passed in as input.

Fields you can set:

  • command: the only mandatory field
  • hostname
  • port
  • privateKey
  • username
  • password

Output: message.payload contains an object with the following fields:

  • exitCode: the command's exit code
  • stdout
  • stderr

Configuration

  • Name: name of the node
  • Private Key: ssh key path (optional but recommended)
  • Hostname: address of the target SSH server
  • Username: username of the target SSH server
  • Password: password of the target SSH server (set this if not using ssh key)

To-Do (help wanted)

  1. Add feature to reuse hosts/accounts instead of having to re-add every time 1. Add output so that other nodes can consume the result 1. Add option to consume more information(e.g. hostname) from other node

About

Simple ssh client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 64.1%
  • HTML 35.9%