I had the same problem, and i finally found the solution.
The command line ha
needs a token to work. To have the environment variable SUPERVISOR_TOKEN
you need to call a script to set this variable.
This command is working (you should test it)
ssh homeassistant "source /etc/profile.d/homeassistant.sh && ha core info"