Is your Raspberry Pi showing on your network. If so a simple thing you could do is pop your SD into a card reader, create a blank text file and save it as SSH without an extension and drop it into the /boot folder of your SD card. That will enable ssh for you.
I’m trying to execute a ssh command with shell_command, but I’m getting an error 255 which I think is due to permissions relating to where the command is coming from.
If i ssh into the hassio machine, and try to ssh into the target, I need a password. I can set up key based login but it only works from the hassio shell.
If I use the terminal addon, I need to set up a new key based login as the other won’t work with it (is it because it is a separate container?).
Based on the above, I am assuming I need another key in the homeassistant container to be able to use the shell command, but I can’t figure out how and where to create that one.
Edit: found another post that showed I had to move the keys to config and then pass that location to the ssh command as ssh -i /config/ssh/id_rsa user@ip "command" but still getting an error
It seems I’m having a very similar problem as @SteveM363 - I have an automation that calls a shell_command, yet fails with the same 255 error previously mentioned. I’ve taken the same steps to move the key and reference it in the shell script but alas, the same results.
Here’s what I’ve been able to learn:
executing just a simple ssh -V from the script succeeds - I can prove this by directing the output to a text file as well as viewing homeassistant.log
executing ssh user@remote-host command will succeed from the command-line (when run either as root or with sudo) but will fail with a 255 in homeassistant.log
adding the -E outfile.log directive to the command results in the message “Host key verification failed.” regardless of whether or not I reference the key using the -i directive
Not trying to hijack a thread, just hoping I can help solve the issue. Ultimately I’m just trying to accomplish the following:
Roku changes state by going into screensaver mode
HA recognizes the state change and triggers an automation with a shell_command
shell_command sends an ssh command to change the input on the TV to display something useful
I’m happy to provide any other info that would prove helpful.
I gave up, I was trying to reboot a pi if a sensor failed but was unable to get it done.
As it is a rare case, it usually is stable for months, I haven’t pursued it too hard.