Persistent SSH Node


Is there something like a persistent SSH node available? I'm hoping it can behave like this: when Node-RED starts up or Deploy is pushed I'm hoping it can connect and then wait for input. Likewise, anything that is received would then be sent to the output.

I found node-red-contrib-bigssh but it's not a persistent connection. It connects, sends the command, returns the output and then disconnects.



Not really a good idea to tie Node-RED into a persistent SSH connection. It is better to manage the connection externally.

One thing you can do with SSH is to create a "tunnel". This lets you define a local IP port that connects you to a remote IP port. So you could set up a service on the remote device that talks over that tunnel.

For example, you could have Node-RED running on both ends and use the TCP in/out nodes to communicate directly. Or you could have an MQTT broker on each end. Or indeed many other variations.

Not hard to set up the SSH client to run as a background process.



Whats the reason behind it not being a good idea?

I'm trying to communicate with a Cisco switch over SSH on the same layer 2 network.

Input (data sent) <---> Persistent SSH node to switch <---> Output (data received)



Two large, disparate clients linked together? What's to like about that? Also SSH is meant to be secure, tying it to a NodeJS service - what could possibly go wrong?

Of course, that's just my opinion. Nothing stopping you.

Does it support SNMP? That is designed for ongoing monitoring and is likely to be a better solution.



It does support SNMP, however, I'm also trying to connect to Cisco TelePresence device. While both do support SNMP, the TelePresence is very limited from an SNMP standpoint. Just wanted to keep everything consistent.