Syntax for shell command to SSH into raspberry pi

I have a pi running hass.io and a second pi running a kiosk (page within local hass.io). Since the kiosk starts in full screen mode without a UI or physical keyboard, there is no way to restart/shut it off without SSHing into it remotely. I can do this from terminal, but I want to do this from UI to make it easier.

I think my syntax is off, can anyone help?

configuration.yaml

shell_command:
  kiosk_ssh: ssh pi@CORRECT_IP
  kiosk_yes: yes
  kiosk_password: HIDDEN
  kiosk_reboot: sudo reboot

Then, with a script (using UI) I trigger kiosk_ssh, then kiosk_yes, then kiosk_password, then kiosk_reboot. If I type these commands in this sequence into terminal, it successfully restarts the pi, so I know my commands are correct.

Any suggestions? Thanks!

Follow this great video.

The format for the shell command was a bit difficult to figure out. I can send you mine if you need it.

Cool! Yeah I think the format for the shell command is the part I’m stuck on. Looks like he does:

ssh -l adrian 10.10.10.248 "sudo reboot"

I’m doing:

ssh [email protected] 'yes' 'PASSWORD' 'sudo reboot'

Which is still off. My setup is slightly different - I have a username and password.

What do you do for yours?

Ok here’s my command…

ssh -F /config/ssh/ssh_config -i /config/ssh/id_rsa [email protected] ‘reboot’ 2> /config/command.log

From what I remember, In Hassio you’ll find the “ssh” folder under /root. You’ll need to move that folder to /config.

Password is not necessary in the command, once you generate the keys

2> /config/command.log is for debugging

Thanks! I’ll give it a shot.