Openhab Console - not possible to set password of user openhab

Dear collegues, I’m having trouble to enter in OpenHab Console with user and password. It seems very easy if you don’t remember the credential to reset new ones as in this tutorial is indicated (this is the link) . But I really I’m struggling with this problem because:

  1. if I try to modify them manually I struggle with the problem of Karaf Console and I cant find anything inside the “users.properties” properties file
  2. if I try to modify them by Linux shell ( sudo sed -i -e “s/openhab = .*,/openhab = securePassword,/g” /var/lib/openhab/etc/users.properties), I receive from an openhab message “Error executing command: login failed”.
    My configuration is this Openhab 3.1.0 (on raspberry)
    I launch: ssh -p 8101 openhab@localhost from Ubuntu 20.04.3 LTS
    Hoping answer to my question can be useful for other I give you 2 screenshot


How does the current entry in your file look like?
You can check it by using the command:

grep openhab /var/lib/openhab/etc/users.properties

Hi Wolfgang it appears so:
openhab = {CRYPT}4F61A0FD056BC0FD8231899EC4D9F9CA06AF0DEC895B2A3B0773F6FBC1C99776{CRYPT},g:admingroup

That seems to be the default entry with encryptted password habopen. Not sure where the underscores are gone:

openhab = {CRYPT}4F61A0FD056BC0FD8231899EC4D9F9CA06AF0DEC895B2A3B0773F6FBC1C99776{CRYPT},_g_:admingroup

Thank you Wolfagang. But I suppose that the problem is not in the users.properties file. In fact I changed the password but the problem with page persists.

And in openHab Log Viewer (frontail) I have this message:
2021-11-22 09:28:05.248 [WARN ] [uth.internal.AbstractAuthPageServlet] - Authentication failed: User not found: openhab

Seems you are not able to login to the UI, so the following link will help:

It is important not to get confused about what user you are working with at any give time. There are three types of users you will have to use when working with openHAB.

  1. Operating system user: for example the user used to log into the machine where openHAB is running. On openHABian there are two OS user accounts you may have to worry about: openhabian which is the user you long in as and openhab which is the user that the program openHAB runs under. The openhab user doesn’t have a password and cannot be logged in as.

  2. The Karaf console: this is a command line based low level administration interface to monitor and configure the openHAB program. By default there is an openhab user here with the password habopen. This user has nothing to do with the openhab user from 1. The password can be changed by editing /var/lib/openhab/etc/users.properties.

  3. openHAB Users: these are the credentials that one will use to interact with openHAB through MainUI. These users are not related to the users in 1 and 2.

3 Likes

Thank you Rick for your replay. It helps me to clarify some concepts. So related at the point number 3) my question is: how can reset the credentials to re-enter in openHAB through MainUI?
Many Thanks
Mauro

You can’t do it through MainUI. You have to follow the instructions @hmerk linked to.

Or use the karaf console: