I use Home Assistant OS 17.2 (Home Assistant Core: 2026.4.2) with the Add-On: Terminal & SSH
This allows access to a terminal via WebUI and ssh (with GPG-Key, port 2022 as i configured in the WebUI). Both ways seems ok. I get a screen with a prompt named: [core-ssh ]$
Question: Is this a ‘real’ terminal at the Host or something in a docker-container (Sandbox)?
From inside of the HA-Box I see port 22 for the ssh. (?)
The addon is a sandboxed host in a docker container, so you might lack some access there and your setup of keys will not work with scripts.
The CLI you see in the console on the monitor output is for the host, like HAOS, which will not work with scripts either.
What you probably need access to is the home assistant docker container, which can be accessed somewhat with docker commands from the host access, but through SSH you need a developer access.
The cookbook in the community guides section should have the description.