Karaf Console - Access denied

Hi,

I do not use the kraft console often but occasionally. Today (2 or 3 weeks after last use) I could not start it anymore and did the following to restore it:

  • Reboot of course…
  • sudo sed -i -e “s/openhab = .*,/openhab = xxxxxxxxx,/g” /var/lib/openhab2/etc/users.properties
  • sudo ssh -p 8101 openhab@localhost
  • add org.apache.karaf.shell:sshHost = 0.0.0.0

I am now able to connect ssh on 8101 but I can not log in…

  • image

Can the issue be related to the update from 2.1 to 2.2? What else can I try?

audit.log:

2018-01-04 14:01:46.610 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication attempt - openhab
2018-01-04 14:01:46.640 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication succeeded - openhab
2018-01-04 14:01:53.389 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication attempt - openhab
2018-01-04 14:01:53.402 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication failed - openhab
2018-01-04 14:01:54.744 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication attempt - openhab
2018-01-04 14:01:54.751 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication failed - openhab
2018-01-04 14:01:54.920 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication attempt - openhab
2018-01-04 14:01:54.925 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication failed - openhab
2018-01-04 14:01:55.088 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication attempt - openhab
2018-01-04 14:01:55.097 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication failed - openhab
2018-01-04 14:01:55.493 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication attempt - openhab
2018-01-04 14:01:55.499 [INFO ] [as.modules.audit.LogAuditLoginModule] - Authentication failed - openhab
##   Release = Raspbian GNU/Linux 8 (jessie)
##    Kernel = Linux 4.9.35-v7+
##  Platform = Raspberry Pi 3 Model B Rev 1.2
##    Uptime = 0 day(s). 1:3:1
## CPU Usage = 26.5 % avg over 4 cpu(s)  (4 core(s) x 1 socket(s))
##  CPU Load = 1m: 0.50, 5m: 0.50, 15m: 0.50
##    Memory = Free: 0.32GB (34%), Used: 0.62GB (66%), Total: 0.94GB
##      Swap = Free: 0.09GB (100%), Used: 0.00GB (0%), Total: 0.09GB
##      Root = Free: 25.54GB (91%), Used: 2.45GB (9%), Total: 29.21GB
##   Updates = 0 apt-get updates available.
##  Sessions = 1 sessions
## Processes = 132 running processes of 32768 maximum processes
###############################################################################

              Welcome to            __  _____    ____  _
            ____  ____  ___  ____  / / / /   |  / __ )(_)___ _____
           / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  / / __ `/ __ \
          / /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ / / /_/ / / / /
          \____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/_/\__,_/_/ /_/
              /_/
                  openHAB 2.2.0-1 (Release Build)

Can someone help?

Do you changed the Password for Access? I running in the same Problem… if I go back to hapopen… Access works.

make sure that the last 2 lines of /var/lib/openhab2/etc/users.properties show the following:

openhab = <place_password_here>,_g_:admingroup
_g_\:admingroup = group,admin,manager,viewer,systembundles

This docs entry: https://docs.openhab.org/administration/console.html#changing-the-password

is problematic… we need to update it (edit: not really… the instructions work fine)

2 Likes
_g_:admingroup in first line was missing

Thank you!!

1 Like

this is the issue that was identified by @rlkoshak here: The instructions for changing the Karaf ssh password is incomplete · Issue #345 · openhab/openhab-docs · GitHub

I was not able to replicate the issue… I followed the instructions and they worked fine for me:

Before the sed command:

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

execute (as per http://docs.openhab.org/administration/console.html#changing-the-password):

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

with OH2 service running

results in (/var/lib/openhab2/etc/users.properties):

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

restarting the OH2 service, encrypts the password and the new file contents are:

openhab = {CRYPT}DEBE062DDAAF9F8B06720167C7B65C778C934A89CA89329DCB82CA79D19E17D2{CRYPT},_g_:admingroup
_g_\:admingroup = group,admin,manager,viewer,systembundles

and the new password works fine