Can't connect to openHAB console

Hello,

I’ve installed openHAB 3 on my PocketBeagle a couple of days ago. The PocketBeagle runs on Debian 10, so I installed OH according to this guide. I think OH is running successfully so far, but I can’t connect to the console.

I tried accessing it via SSH like described here. Therefore, I changed the sshHost in the runtime.cfg file to 0.0.0.0 (Do I even need to do that?) and I opened ports 8101 for the SSH connection and 443 for https traffic like mentioned in this post. If I want to connect to the OH console from my PC to OH on the PocketBeagle with the command ssh -p 8101 openhab@192.168.2.125 (192.168.2.125 is the IP of the PocketBeagle) I get this result:

Password authentication
Password:
Password authentication
Password:
Password authentication
Password:
openhab@192.168.2.125’s password:
Permission denied, please try again.
openhab@192.168.2.125’s password:
Permission denied, please try again.
openhab@192.168.2.125’s password:
openhab@192.168.2.125: Permission denied (keyboard-interactive,password,publickey).

For the password, I entered “habopen” because the default username/password is openhab:habopen.

I also read in this thread that I could use the command openhab-cli console when connected to the PocketBeagle with my normal account that has sudo rights. I then get this:

raphael@beaglebone:~$ sudo openhab-cli console

Logging in as openhab
Password:
Password:
No more authentication methods available

I am new to Linux, so I might have missed something. If so, please tell me. Thanks in advance for any help.

Can you SSH into your PocketBeagle like you normal?

After you have sshed in in the command like enter ssh -p 8101 openhab@localhost dose this open a console?

image

What do you get if you do

netstat -tulpn |grep java

in this example port 8101 is listening on the ehternet interface not just on localhost as the default is.
all listening ports for java ( openhab ) are shown

tcp6       0      0 :::5007                 :::*                    LISTEN      1924/java       
tcp6       0      0 :::8080                 :::*                    LISTEN      1924/java       
tcp6       0      0 :::8443                 :::*                    LISTEN      1924/java       
tcp6       0      0 127.0.0.1:33725         :::*                    LISTEN      1924/java       
tcp6       0      0 :::8101                 :::*                    LISTEN      1924/java       
udp6       0      0 :::1900                 :::*                                1924/java       
udp6  180416      0 :::67                   :::*                                1924/java       
udp6       0      0 192.168.0.26:58999      :::*                                1924/java       
udp6       0      0 :::5353                 :::*                                1924/java

@denominator I get the same results as when I try to ssh from my PC to openhab. It asks me six times to enter the password and I enter “habopen”. After that, it says “permission denied”.

@Wolfgang_S I get this:

raphael@beaglebone:~$ sudo netstat -tulpn |grep java
tcp6 0 0 127.0.0.1:33453 :::* LISTEN 1001/java
tcp6 0 0 :::8443 :::* LISTEN 1001/java
tcp6 0 0 :::8101 :::* LISTEN 1001/java
udp6 0 0 :::5353 :::* 1001/java
udp6 0 0 :::5353 :::* 1001/java

So I think port 8101 is also listening outside of localhost.

Yes, the output of netstat showed that the java process is listening on port 8101 ( as well as to other ports ). As you get feedback to your ssh command as well by being logged on to your host as well as from the outside of that host also I would conclude that the karaf console replies to your trials to connect to it. In case it would only listen to localhost but not on conections to the ethernet interface you would get connection refused.
My conclusion now would be that you changed the default password.
Could that have happened ?

A crosscheck ( although I think that this is not required ) to check what is listening on port 8101 from the outside ( just in case that something on your network is rerouted ) could be that you use telnet to connect to port 8101. This then should show the banner of the service on port 8101.
At least this works for e.g. ssh service / karaf console:

telnet localhost 8101
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SSH-2.0-SSHD-CORE-1.7.0

the last row is evidence that the karaf console is behind port 8101.

When I use the command telnet localhost 8101 and get this:

Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
SSH-2.0-SSHD-CORE-1.7.0

If I understood you correctly, everything is correct because the last line is the same.

I don’t think I changed the password, but to be sure I changed it using this command: sudo sed -i -e "s/openhab = .*,/openhab = securePassword,/g" /var/lib/openhab/etc/users.properties and tried to connect after restarting, but it didn’t worked.

The original password entry for user openhab in users.properties is:

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

Thanks for your answers! I read that after changing the password, you need to restart openhab. I did so before my last answer and tried to log in, but it failed. I restarted openhab there with the command systemctl restart openhab. I restarted openhab a moment ago by stopping and starting it again. After that, I am now able to connect to the console from both my PC and the PocketBeagle. I thought that the restart command would also work.

that is correct - should have worked, too.
Good to know that it now works as expected.