SSH script with Hassio

Hi,

I’m trying to make some SSH script so I can easily reboot hassio when there is some problems.

When I try to run on my SSH client machine: ssh [email protected] 'hassio ho reboot' I have the following output: debug1: permanently_set_uid: 0/0 Error decoding json invalid character ':' after top-level value: 401: Unauthorized

I can run some linux commands like ssh [email protected] 'uptime'

But every hassio Commandline that I try just end up like that:

I’m using a Rpi 3b+ running Hassio 0.83.3 with the SSH server add-on.

Thanks for help :slight_smile:

Why are you ssh’ing as root when you are already ssh’ed as root??? I can’t even see what you are trying to do.

Ssh in and then:
Hassio ho reboot will do it… You are already root…

Hi,

Because he is on a first machine (his MacBook) and try to connect to a second (his hass.io).
Maybe it’s because of the environment variables that are not set correctly to execute hassio commands.

I’ll give a try latter today.

Ah I didn’t notice that… I ssh from my Mac in terminal to hass.io but I use a private key instead of username/password …

Hi,
Because he is on a first machine (his MacBooc) and try to connect to a second (his hass.io).
Maybe it’s because of the environment variables that are not set correctly to execute hassio commands.
I’ll give a try latter today.

Thanks you for taking the time to understand my problem and helping me

I run the same here and I can give you the confirmation I see the same.
I notice that some commands works eg ‘hassio --version’ but ‘hassio ho info’ return
Error decoding json invalid character ':' after top-level value: 401: Unauthorized

I tried to found a workaround without success.

Allright, thanks you so much anyway, now I know that this isn’t a bad configuration on my side.