SSH works from the terminal but not via Home Assistant button/script

Welcome to the forums.

It’s generally a good idea to search the forums before creating a new thread, since odds are your question has been asked (and answered) before.

Have a read through this thread in the Community Guides section of the forums. If the first post doesn’t address how to fix your issue, there’s a good chance one of the replies below it will.