Somebodey can help me with shutting down linux machine.
I run openhab server on win7 and trying to shutdown debian machine with this binding exec=“OFF:ssh debian@192.168.1.101 shutdown -p now” but not work
[ERROR] [.o.b.exec.internal.ExecBinding] - couldn’t execute commandLine ‘ssh debian@192.168.1.101 shutdown -p now’
java.io.IOException: Cannot run program “ssh”: CreateProcess error=2, The system cannot find the file specified
may be this is linux command and cannot bre runned on win machine
Windows does not have a native ssh client. I’m pretty sure Putty comes with a command line utility called plink that is very similar to the native ssh client found on linux machines.
I know this program but I don’t know how can I use it for this binding.
In windows I use exec binding to execute exe files… I compile exe files from bat files because bat files causing me problems. I don’t have any idea what kind of code have to write. I reade a lot of information in Google but can’t find example code for my case.
> plink.exe -ssh -l username -pw password 192.168.1.101 shutdown -p now > plink.exe -ssh -username@192.168.1.101 -pw password shutdown -p now
not works for me, opehHAB return
[INFO ] [.o.b.exec.internal.ExecBinding] - executed commandLine ‘plink.exe -ssh -username@192.168.1.101 -pw password shutdown -p now’
the command is executed but no login on remote machine… on the remote machine i have a way to view last login and no login from openhab, the username, password and IP adress are correct i checked them twice. Here in this post username and password are replaced for security reason.
Did you ever have any luck with this? I have actually been fiddling with this today as ive been thinking of moving OpenHAB to my desktop windows PC and off of my raspberry pi as it’s somewhat unstable on there, but ive been having this exact issue where Karaf says it’s executed the command, but nothing happens.