I am trying to run a script on a remote raspberry pi but have become a bit stuck. I have all rsa stuff in the same folder as the config on the home assistant host. I dont seem to be getting any log at all, its like i’ve got the path wrong, which i potentially have.
I have pasted the code below, I would be greatful for some help on this as I am quite stuck (I’m still a newbie to this)
You might want to give a bit of background to your setup. For example is are you using Hassio, Hassbian, Raspbian self installed… etc. The answers could be quite different for each type of setup.
In addition to the above two questions, I would also point out that ssh is very particular about the permissions on its rsa files. I seem to remember it refuses to connect if the private key file allows other users to read it.
If it is possible in your configuration, I suggest generating a ssh key specifically for the user that is running HA.
I just noticed, is your key really in / (as in the root directory of the filesystem)?
Additionally as @gpbenton mentioned… SSH is very particular about permissions on the keys.
They should be owned by the user that HA is running under when you do an ls -l permission should look like
-rw------- 1 ha_user ha_user_group
if they dont chmod 600 id_rsa should set the perms & chown ha_user:ha_user_group id_rsa should change the owner (obviously replacing ha_user and ha_user_group with the correct ones for your system.
Also I’m looking at the paths you have defined and they dont look like Hassio paths. How did you do your install?
I’m wondering if you might need to add the locations to the whitelist too perhaps
I do get -rw------- 1 ha_user ha_user_group when i run ls-l. I had a couple of issues installing in the first place so looked at a couple of forums so maybe something got put in the wrong place?
I have tried the whitelist but this doesn’t seem to make a difference.
Allan, i think that’s part of the problem. I have changed the path so it is now /home/dan/.homeassistant/id_rsa
I can run the ssh -F /home/dan/.homeassistant/ssh_config -i /home/homeassistant/.ssh/id_rsa [email protected] '/home/pi/Radio.sh' as both my user and the HA user. I can now also run this through HA so thank you all very much for your help!