How to get to OS level from HA CLI in terminal

Hi

Just a note, not the least to myself for future reference :wink: on how to move from the HA CLI to OS level in terminal.

I had issues login root from home assistant CLI. Login incorrect was all I got all the time, even though I used the Advanced SSH & Web Terminal and had the Protection Mode turned off.

What did the trick for me was to use this in HA CLI

nsenter -t 1 -m -u -i -n -p -- sh

This got me out of the HA container and in to the OS level.

This was needed in my case in order to update my RaspBee device, works the same for the ConBee device too.

2 Likes

Could you reformat this using the quote symbol in the editor? The last part looks like a long dash followed by ā€œshā€ but not sure… but if one did a copy-n-paste into the command line shell, it fails.
I think you mean to say that the command is nsenter -t 1 -m -u -i -n -p sh

1 Like

Thanks for noticing! Fixed it!

I copy-pasted that one too, but didn’t work.

~ $ bash nsenter -t 1 -m -u -i -n -p -- sh
/usr/bin/nsenter: /usr/bin/nsenter: cannot execute binary file

Sorry, my mistake, again. bash shouldn’t be there. Don’t quite understand how it got there. Try

nsenter -t 1 -m -u -i -n -p -- sh

I just double checked that it works. Logged on via windows CLI and ran this, worked fine.

OK, yep that seems to work.
Let me ask separately, I myself haven’t figure out what this did to help you.
For example, there is still no access to say /lib/firmware/ with all the device’s firmware files that the HAOS kernel uses. So what were you able to do after using this command that you could not do before?

I could update the firmware of my RaspBee II device.

Is this what you mean (Section titled ā€œUpdate In Dockerā€)?