How to get access at damn host system?

Not sure what you mean. The login banner at console states the command necessary to exit hassio-cli and access a local root shell. Are you not seeing that?

Authentication. Authentication. Authentication.

Not authentification

1 Like

Exactly but the command is not working i get some logs scrolling on screen related to some processes but from there i don’t even have any Shell back so not sure how it’s supposed to work and have been unable to find any doc about it :confounded:
Side note no help avalaible in cli for that “login” command…

Sorry in french we say authentification :smiley:

I have noticed that the “login” command isn’t mentioned in the help screen for hassio-cli, just in the login banner. That confused me for a while too.

Just to confirm: you have a keyboard and monitor connected to the device running HassOS. You can see all the boot messages scrolling by at boot. You can press enter/return to get to a login prompt. You can login to see the login banner and get to the hassio-cli prompt.

At that point, typing “login” doesn’t drop you to a root shell? This has worked for me.

3 Likes

Hi Vincen,

Yes, this is confusing, isn’t it?

Not sure how much you know here, but the following might be useful (as I understand the situation, being fairly new to HA, and just working this out by exploration):

  • Homeassistant under Hassio is running in a Docker container. If, say, you use the SSH add-on and then ssh into the Pi, you’re normally connecting to the SSH daemon running inside the homeassistant container. [Update: I made a mistake: you’re actually inside the ‘SSH server’ container, so you won’t see HA running there, but you have access to the /config folder and the hassio command.]

  • If you get access to the hassio-cli (either by enabling the host SSH access on port 22222) or, I guess, by plugging in a keyboard as you’ve done, then typing ‘login’ from there takes you to the host system.

  • You can then run docker ps to see the containers that are running. These would normally include the one called homeassistant.

  • You can run docker container inspect homeassistant to get a big json dump of info about that container.

  • One of the things buried in there is the fact that /mnt/data/supervisor/homeassistant on the host is mounted as /config inside the container.

I think that’s where you’ll find your config files. Does that help?

All the best,
Quentin

25 Likes

Thanks and @quentinsf too and I confirm you that login command doesn’t work ! I never get access at root of host system which is all my problem !! I get access with a physical keyboard and screen at hassio-cli without problems but no way to get access at root of host system :frowning:
Thanks Quentin for explanations, I’ll save these as it can help for later :smiley:

1 Like

Can you not edit files in hassio-cli?

1 Like

nope and I don’t think the problem is there ! It looks like the doc on website is completely wrong/outdated for my problem !!
I have found a way to do what they say:
I login in hassio-cli and shutdown HA
I use the samba share I had setup in hassio to access files and delete the auth and hassio file (the other files listed on ha website never existed in my system)
I then restart HA from hassio-cli to discover it’s still f*cking stuck at login without any chance to create account :face_with_symbols_over_mouth:

Side note: here is what I have but pretty useless if I have well understood documentation on website as ha authentication system is the one by default if none is indicated !!

  auth_providers:
    - type: homeassistant
    - type: legacy_api_password

Out of crashing everything and restarting from scratch looks like it’s impossible to get system back to normal for identification if you loose existing credentials :frowning:

This is wrong.

Completely wrong. You don’t need any of that. At all.

You need to go into the .storage folder and delete all the authentication files in there.

Already tried but just to be sure, this is what I did just now:

  • stopped ha from hassio-cli
  • commented out all auth_providers section and http section in configuration.yaml of ha
  • deleted the auth file in .storage folder (it’s the only file I have starting by auth in that directory, tried also with deleting too the hassio file in that directory (it looks to contain some identifications informations)
  • restarted ha from hassio-cli
  • still the same, ha asks to login straight without any way to create a login :frowning:

Desperate to recover access at my ha :tired_face:

No!

Do NOT comment out http:

@vincen
Let’s pause with all the attempts at workarounds - I think that might make things worse.
Let’s go back to attempt to access root shell. You keep saying it doesn’t work, but don’t say anything about what actually happens. Following from my previous post, what happens when you type “login” at the hassio-cli prompt? Any chance you could snap a picture of that view on the monitor connected to your HassOS host?

If he just deletes all the auth in the system it will prompt him to set up a new user

no changes, still the same :frowning:

side note: you speak always about multiple auth files to delete but I have always only one recreated there that is named auth ! all others are unrelated (esp files, lovelace and hassio and core* ones).

side note bis: I noticed an home-panel.db file in main config directory that contains a login and pass :confused: is it related to main ha authentication or not at all ?

Well the point to get access at root shell was to be able to delete files without web access at ha but stopping ha from hass-cli still lets web editor addon running and so can do it this way :wink:
Once I have solved the access problem I can share details about “login” command not working on my system !

Right. You’ve mentioned that you have some sort of access to change the configuration.yaml file. So using that same access, you just need to delete .storage/auth file and restart HomeAssistant. With that file missing, next web login should prompt you to create a new account.

If that doesn’t work, my guess is that you are either accessing the wrong location or there is a larger/different issue (browser cache?).

One more thought, rename the onboarding file in .storage to onboarding.old .

Restart HA and try to login.

I only say delete anything related to auth. I don’t mean there are more than one but if there are you delete them

1 Like

This time I deleted the auth file and tried first login with a different browser (Chrome in which I had deleted all cache, history…) but still the same !! I get that directly !!
login
One thing I noticed is that the url I type is https://192.168.1.8:8123 but it gets redirected by ha in something like that:
http://192.168.1.8:8123/frontend_es5/authorize.html?response_type=code&client_id=http://192.168.1.8:8123/&redirect_uri=http://192.168.1.8:8123/?auth_callback%3D1&state=eyJoYXNzVXJsIjoiaHR0cDovLzE5Mi4xNjguMS44OjgxMjMiLCJjbGllbnRJZCI6Imh0dHA6Ly8xOTIuMTY4LjEuODo4MTIzLyJ9
Normal ??

As indicated previously that file has never existed on my system !! What is it supposed to contain ?

That is not a home assistant file. Perhaps an add-on or customization you did

1 Like