I have a raspberry pi zero 2 W that I'm using a to run a raspberry pi camera with HA/MQTT support called picam2ctrl.
One of the features of the program is that it can automatically copy image and video files to the ssh server that HA is running.
I have done the following steps to try to get an ssh connection between the client pi and HA working:
- Generate a public and private key using this command on the client device:
ssh-keygen -t ECDSA -b 521
and entered blank passphrase for the generated keys. - Installed the terminal & ssh official HA addon
- Copy the result of the below command into the authorised keys field on the SSH addon configuration page:
cat ~/.ssh/id_ecdsa.pub - Save the addon config and restart it.
However when I try to enter ssh root@homeassistant.local from the client device, I get this error:
ssh: connect to host homeassistant.local port 22: Connection refused
I also tried to use this command to copy the key to HA:
ssh-copy-id -i ~/.ssh/id_ecdsa.pub root@homeassistant.local
However it also failed with the same error:
/usr/bin/ssh-copy-id: ERROR: ssh: connect to host homeassistant.local port 22: Connection refused
How can I setup the ssh connection between the client and HA correctly?