Locked out of Console

I wanted to access my Karaf console via VScode and followed the recommended instructions in allowing access to all interfaces and then changing the default password.

After first uncommenting to allow for all interfaces, I was able to access the console via VScode. But after I changed the password, I can’t access the console anymore, both either locally on the OH2 machine or via VScode. I’ve since gone back and commented out the access to all interfaces in the runtime and also have attempted changing the password back to the default of habopen to no luck.

I’ve also tried resetting the password both manually and also via the command line all from the docs here.
http://docs.openhab.org/administration/console.html#changing-the-password

So not sure what could be wrong or how to regain access.

post the contents of your /var/lib/openhab2/etc/users.properties file plz

the last 2 lines should look like:

openhab = {CRYPT}7FD[...]DD9{CRYPT},_g_:admingroup
_g_\:admingroup = group,admin,manager,viewer,systembundles

restart OH2 after changing this file

ok, I see a slight difference, This is what I have after setting the default habopen as the password. Let me adjust readding the g:admingroup after the cyrpt and see what happens.

openhab = {CRYPT}4F61.....99776{CRYPT},
_g_\:admingroup = group,admin,manager,viewer,systembundles

Yet attempts to ssh to the console on the local machine keeps failing. It accepts the first password I had tried with, and then prompts for another password that still fails with openhab or other attempts.

Edit.

That fixed it. I’m not sure I deleted the ending info after the crypt or not. I’ll keep testing a little and see what I can learn.

Ok.

I think I confirmed there is an error in the docs. When you run this command

sudo sed -i -e "s/openhab = .*,/openhab = MyNewPass/g" /var/lib/openhab2/etc/users.properties

I see this in the file and it appears to be missing that comma after the password. And then when you stop and restart OH2, it encrypts the entire string, thus causing the problem.

openhab = MyNewPass_g_:admingroup
_g_\:admingroup = group,admin,manager,viewer,systembundles

Yes, obviously the comma is deleted erroneously.

Could you please fix it?