I just battled this (again) for a couple hours as I was seeing the error unable to update known_hosts
(via addition of a 2>log_file_name
to the command) after upgrading. I’m running HA Supervised under Debian Linux (i.e. docker containers). Every time I upgraded I had to manually re-initialize keys. The problem is that inside the homeassistant docker container, /root/ is one level above /config/ inside the container and so is not /root/ from Linux shell. The light bulb came on when I opened a console into homeassistant docker container and did cd /root; ls -al to see something completely different and voila, the answer, almost. I searched for how to specify a different file/location for known hosts and it’s a -o option: UserKnownHostsFile=. So my new command which immediately fixed the error and should survive upgrades is:
command: ssh -F /config/ssh_config -i /config/ssh_config/id_rsa -o UserKnownHostsFile=/config/ssh_config/known_hosts -o StrictHostKeyChecking=no [email protected] 'cat /sys/class/thermal/thermal_zone0/temp' 2>/config/ssh_command.log