Restart Home Assistant via SSH Addon Remotely

I currently am running Let’s Encrypt and DuckDNS to update my public IP address and they are both running on pfsense. I am attempting to push the cert and key to my HA via automatic actions. I can basically do everything with the exception of restart HA. I am attempting to run:

ssh -i /root/.ssh/privkey root@ “ha core restart”

when running I get:
time=“2021-12-11T00:02:46-06:00” level=error msg=“Unexpected server response. Status code: 401”
Unexpected server response. Status code: 401

Essentially I want to restart HA in an automation fashion from as shell script remotely.

1 Like

not sure if you figured this out already, but for anyone else who has this (or a similar) question, i believe it was answered here: Error when trying to run "ha snapshots new" over ssh - #4 by xen

1 Like