Closed asbesto01 closed 4 years ago
What you're after is called ssh key authentication
. That way you can setup a key which will act as your password, that way you'll never need to have your password in cleartext. I think it's mentioned in the README.
As for the automatic turn on, I can't say for sure what's happening. If you run the shutdown command manually in a terminal, does your Mac wake up afterwards as well? This doesn't really sound like something this plugin would cause.
Ciao Alex, thank you so much for your reply.
two points:
1) is it possible to perform a ssh key auth from a Windows host (that's where my home bridge runs in a command prompt) towards a Mac? Or it is required for example a linux environment such as a raspberry pi?
2) if plugin is installed and I put my Mac asleep from it, then it wakes up back. If plugin not installed, it goes sleeping perfectly :(
Any platform with SSH should support SSH keys. It’s a fundamental part of the software.
Does the Mac wake automatically every time? There are three possible reasons I can see:
Were you able to solve this issue?
Closing due to inactivity. Feel free to reopen if the issue persists.
Installed and correctly launched the Homebridge-WOL plugin on my Windows Homebridge server in command prompt, with following instructions:
"accessory": "NetworkDevice", "name": "MacMini", "mac": "1234", "ip": "192.168.0.189", "pingInterval": 45, "wakeGraceTime": 5, "wakeCommand": "ssh stefano@192.168.0.189 caffeinate -u -t 300", "shutdownGraceTime": 60, "shutdownCommand": "ssh stefano@192.168.0.189 pmset sleepnow"
when I try to shut it down VIA LAN, I receive:
[2020-3-15 23:17:12] [MacMini] NetworkDevice shutdown cycle started for "MacMini" (192.168.0.189) [2020-3-15 23:17:12] [MacMini] NetworkDevice "MacMini" (192.168.0.189) went from status "Online" to "Shutting Down" [2020-3-15 23:17:12] [MacMini] Attempting to shut down "MacMini" (192.168.0.189) using "ssh" Password:
HERE I insert the password manually (is there a way to store it in the config.json?)
The Mac shuts down perfectly, however it wakes by itself after some seconds. Terminal shows:
[2020-3-15 23:17:20] [MacMini] Waiting for shutdown grace time (60000ms) for "MacMini" (192.168.0.189) [2020-3-15 23:18:20] [MacMini] NetworkDevice "MacMini" (192.168.0.189) went from status "Shutting Down" to "Online"
How to stop the auto turn-on? How to specify in the config.json the password ?
Thanks!!!