How can I connect to a server by SSH connection?

Hello everyone!

I am a bit lost on the tools I can use to make a connection to a server in node-red. My idea is to shutdown a server from the platform, for that I was thinking to make an ssh connection with the server and run a command on the server's machine. Is this possible to do? If so, how?

Thanks in advance!

try the node-red-contrib-bigssh node
havent used it myself but it says in its description

Big SSH is an input node for node-red to execute command over ssh to a remote host Command can be set as a property of the node. Payload can be used to add arguments to the command and now, the command can be a javascript template string and payload the variables

You can use the exec node to run a remote command over SSH. Look up how to do a command line SSH connection and automatically run a command.

Best done if you set up certificate based access to the server so you don't have to faff with ids and passwords. Also, if you need to run a remote command requiring sudo, you might want to mess with the servers sudoers entries so that you don't need to enter an additional sudo password (which won't work via exec).

Thanks, that's just what I was looking for. I think I can work with that from now on

Ah yes, that makes sense. Thanks for the tip

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.