Giter VIP home page Giter VIP logo

node-red-nodespect's Introduction

SSH Interactive Node for Node-RED

The NODE-RED-EXPECT-TCL is a set of custom Node-RED nodes designed to establish an interactive SSH session to a remote server. It allows dynamic execution of commands within this session based on input messages, providing flexibility for automation tasks that require SSH connectivity.

Features

  • Dynamic Connection Parameters: Allows SSH connection details (host, port, username, password) to be specified dynamically via input messages, with the option to fall back on static configurations.
  • Interactive Session Management: Maintains an interactive SSH session, enabling the execution of multiple commands in the context of a single, persistent session.
  • Connection Status Feedback: Provides visual feedback within the Node-RED editor on the connection status, changing node color to indicate when the session is connected or disconnected.

Installation

git clone
cd node-red-nodespect
npm install

Pallet Manager to come

Usage

  1. Configuration: Drag the SSH Connection Open into your flow. Optionally, configure static default connection parameters (host, username, password, port, privatekey, passkey) in the node's settings if you want to have fallback values.

  2. Dynamic Parameters: Send an input message to the node with payload properties specifying host, port, username, password, privateKey, and/or passphrase for dynamic connection setup. Example message payload for dynamic parameters:

    {
      "payload": {
        "host": "example.com",
        "port": 22,
        "username": "user",
        "password": "password",
        "privateKey": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----",
        "passphrase": "password"
      }
    }
  3. Executing Commands: Once connected, send additional input messages with the payload.command property set to the command you wish to execute on the remote SSH server. The node maintains the session for subsequent commands.

  4. Connection Status: Monitor the node's status in the Node-RED editor for connection feedback. A green node indicates an active connection, while red signifies disconnected.

  5. Session Closure: To close the session, either deploy changes, stop the flow, or send a command to explicitly exit the session if needed.

Security Considerations

  • Handle sensitive information like passwords with care. Prefer dynamic input for sensitive details and secure the flow of these messages within your Node-RED environment.
  • Consider using SSH keys for authentication where possible for enhanced security.

Dependencies

  • Requires the ssh2 npm package for SSH connectivity.

License

Author

  • Grey Dziuba / GitHub @gdziuba

node-red-nodespect's People

Contributors

gdziuba avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.