I know its more of a general Linux question, but I’ll ask anyway - been searching everywhere without finding a solution.
I’m trying to start/stop/restart the HA service on a remote machine.
So far, I have tried this:
sudo systemctl --host [email protected] restart home-assistant@homeassistant
Even though I have added the following lines to the sudoer file on the target machine it doesn’t work remotely:
pi ALL=NOPASSWD: /bin/systemctl start home-assistant@homeassistant
pi ALL=NOPASSWD: /bin/systemctl stop home-assistant@homeassistant
pi ALL=NOPASSWD: /bin/systemctl restart home-assistant@homeassistant
The status command seems to work, but even when I add it to the sudoer file, it keeps asking for the password.
sudo systemctl --host [email protected] status home-assistant@homeassistant
Might it have to do with the fact that I run HA in a virtual environment?
When I execute the commands directly on the machine it all works fine.
sudo systemctl restart home-assistant@homeassistant