Shutdown or Restart Remote Linux Devices

Hi,

at the moment i try to find out how i can use Node-Red Dashboard with Buttons to shutdown oder Restart remote Servers. I found some threads, but no one helped me for a solution.

the Flow must do:
Login via ssh on the Device with username and password
execute shutdown Command.

do anyone have a flow for me?

Thanks

Setup ssh to use keys, not user/pwd, then it is much easier.

1 Like

i cant do it on the machine. this ssh server is very dump and not support ssh keys.

Write a script (python?) to run all the time on the server which subscribes to an MQTT topic and reboots.

Or, install Node-red, same MQTT topic, and reboot via an exec node.

1 Like

I'm using myself node-red-contrib-ssh-coco (node) - Node-RED to shutdown remote server.
However my experience is the same as from Colin that using a ssh key was also with this node the most reliable way.

Agree with @jbudd that running a service on each remote is the best approach. Though, of course, security is still an issue.

There are all sorts of admin tools out there that will expose REST API's as well so that you can issue a command remotely. But running Node-RED is one pretty simple way.

Cant install anything on this servers. its a system like a container with no installs or repos. only flashed by image with simple ssh access. The only i can change is username and password of ssh user. also only 10gb hdd storage with 8,9gb full.

As mentioned earlier, I do this with a simple MQTT topic and an Exec node. No need for ssh at all.

The guy can't install anything, so can't use mqtt.

Ah, so node-red is NOT on those machines? If true, then I misunderstood.

@corin.corvus Would doing a reverse ssh help?

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