How to ssh from HA terminal to linux machine

I am trying to set up passwordless access from HA on Raspberry Pi 4 to a linux computer. I went through all of the steps I found to create private and public keys. No matter what I do the remote system still asks for a password. Is it possible to pass a username/password to the ssh login?

Is password-less login to your linux server working from a terminal (not HA)?
Are you trying to create a command_line sensor, remote_commd, or…?

I can ssh login into my linux server from HA terminal automatically. If I run terminal add-on and issue “ssh [email protected] ‘/usr/bin/bash -c /home/rohland/PythonScripts/RunVLCPlaylists/run_am.sh &’” it works. However if I create a shell command in configuration.yaml with " bash ssh [email protected] ‘/usr/bin/bash -c /home/rohland/PythonScripts/RunVLCPlaylists/run_am.sh &’" and then call that shell in an automation it does not execute

The terminal addon is not the same environment as where HA will run the ssh command.

You likely have to specify the location of your ssh private key on the command.

You’ll need to run the command in the HA docker container. Most likely, since it is the first time for the ssh connection, it is asking whether it should trust the ssh keys. Attach a shell to the docker container and run the ssh command manually to verify.

Use something like:

ssh -4 -o StrictHostKeyChecking=no -i '/config/ssh/id_rsa' [email protected] '/usr/bin/bash -c /home/rohland/PythonScripts/RunVLCPlaylists/run_am.sh &'

After putting you private key as /config/ssh/id_rsa