Shell Command SSH

I recently added a Wake On Lan switch for my nas.
I would like to add an option to turn off the nas again so I added a shell command.

shutdown_nas: "ssh -i /config/ssh_keys/nas homeassistant@<domain> shutdown -p now"

The shell command does not work, so I tried the command itself from the home-assistant instance
itself via a ssh connection, this worked fine.

Does anybody have clue why this shell command does not work?

Try adding -o "StrictHostKeyChecking=no" to your command line

shutdown_nas: "ssh -i /config/ssh_keys/nas -o 'StrictHostKeyChecking=no' homeassistant@<domain> shutdown -p now"

@Tinkerer Thanks that is the solution :smiley:.