Run SSH command

Is there any way to run from HR a SSH command using PLINK from PuTTY, like the following:
plink -ssh -batch user@server_IP_address -pw password sudo wakeonlan -i host_address mac_address
Thank you very much

If it’s WOL that you’re looking for, I thought THR has that function now.

For what you’re trying to do, I use Node Red; pretty simple to create a TCP listener that will end up running the command in an exec node, and then create a THR plugin to send the commands/receive the response.

Many thanks for your answer, I guess you’re talking about Running on Windows : Node-RED, I’ll have a look, and I guess it’s compatible with Windows and Android…
A while ago I wrote my plugin for WoL which works quite well and works over VPN.
The problem is that recently I changed 2 Unifi USGs with a Cloud Key Gen2 by 2 UDM Pros and I’m struggling configuring the DNS Server, which apparently needs to be set to Auto mode if you use the internal server. I just realized that the server was set in manual mode, but although it had the correct settings, it was not working well and thus the WoL command was not working through the VPN. I then started to find a temporary workaround, but it’s working fine now.
Many thanks again!

1 Like

Well I have Node Red running in a container in my NAS as well as a raspberry pi for those devices That I interface with over a physical connection (e.g. MiniDSP and a digital poster I made). But a dedicated Windows system would work if it’s always on I suppose.

(I figured you could just use a Linux command line to send the commands instead of plink).

What linux command line shall I use?

Well, if you install node red, you don’t even need the command line as there is a WOL module you can install.

If just going a pure linux route, you can look into etherwake.

Actually “sudo wakeonlan …” is also a command, the point is how to lanch it from HR ?

Yes you can use wakeonlan too. I didn’t know that had to be run as root though (implied by the use of sudo).

Here is a Proof of Concept / very basic flow I created for you in Node Red. You need to ensure the command in exec has the path to your wakeonlan executable running on the system where you’ve installed Node Red, and all the necessary parameters are specified.

WOL Node Red Flow.txt (2.6 KB)

From THR, create a plugin that sends the text string “WOL” to the port configured in the flow (12345).