Remote control Raspberry Pi with shell_command and SSH

There’s a community guide for SSH:

Your problems probably stem from the fact that the shell_command runs inside the Home Assistant container while you are testing your commands outside of it.