openhab / openhab-linuxpkg

Repo for Linux packages
Eclipse Public License 2.0
18 stars 33 forks source link

Reinstallation with apt-get on RPI, Karaf doesnt react. #90

Closed Josar closed 6 years ago

Josar commented 6 years ago

Hello,

i posted an issue on openhab-distro and was delegated to here by @BClark09.

Maybe someone here thinks this schould be solved.

Following the uninstall and install opening the Karaf console takes very long. I uninstalled and reinstalled openhab twice because i was very impatient the first time i tried opening Karaf after uninstallation. I Also restartet the RPI. But then i got following message:

ssh -p 8101 openhab@localhost @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by the remote host is SHA256:XXX Please contact your system administrator. Add correct host key in /home/pi/.ssh/known_hosts to get rid of this message. Offending RSA key in /home/pi/.ssh/known_hosts:1 remove with: ssh-keygen -f "/home/pi/.ssh/known_hosts" -R [localhost]:8101 RSA host key for [localhost]:8101 has changed and you have requested strict checking. Host key verification failed.

The answer is to delete the RSA key from the known host. But shouldnt that also be taken care of when uninstalling? Maybe addig following line to the tutorial or imlement it in the uninstall routoine would be a solution. ssh-keygen -f "/home/pi/.ssh/known_hosts" -R [localhost]:8101

I think at least cleaning up all thinks that could have been initialized is a good way of uninstalling! Maybe i´m just to precise.

Thank you in advance, Josua

BClark09 commented 6 years ago

IRT the known hosts changing:

I think this can be checked before the uninstall completes, although because the file isn't generated by apt or by openHAB the uninstaller shouldn't touch it. Only advise that it exists and that it it's advisable to remove when reinstalling. So:

  1. On uninstall check if a known host exists at [localhost]:8443
  2. If it does send a message to the user mentioning this.

I also agree that a mention of this problem should be in the docs, it will affect manual users as well as automatic users as soon as Karaf is changed and ssh is used to connect to console. @ThomDietrich, do you have any thoughts on this?

BClark09 commented 6 years ago

Hi @Josar, after some trials I came to the conclusion that it would not be viable to do anything during uninstallation about this because:

  1. The known-hosts file is produced by ssh tools, not by openHAB. And implementations of this change between versions.
  2. The ssh command wouldn't have necessarily been sent from the localhost.
  3. openHAB is installed as a program but the known-hosts file belongs to the user, it would be difficult to go through any user who may have used ssh and find a known-hosts file.
  4. Perhaps the most appropriate way of connecting to the console is by using the openhab-cli console command that makes it's way to openHAB 2.2.0 soon.

I will be sure to set expectations by updating the docs about what may happen though, and hope that this resolves the issue for you.

Kind Regards, Ben