openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
818 stars 251 forks source link

Default username/password with Openhabian v1.7.5 #1746

Closed arch1v1st closed 1 year ago

arch1v1st commented 1 year ago

Hello,

It seems the latest Openhabian release (v1.7.5, 32-bit) has a different username/password for accessing SSH which was previously 'openhabian:openhabian' by default, and doesn't prompt to set one during installation. I appreciated how streamlined the install process was, but couldn't login after the fact. After fighting with it, rolled back to 1.7.4b, which prompted me to set the password during install before kicking off its automatic system updates. Up and running now! Openhabian ROCKS!

Hopefully this helps to save others some time and frustration too. :)

bohni commented 1 year ago

I also started with a fresh 3.4.0 Openhab by flashing Openhabian 1.7.5

I can open the browser at openhabian:8080 and run through the setup - set location, select addons etc. I also can open settings to start set up my model and so on. Running "ssh openhabian@openhabian" leads to login, but the password 'openhabian' is not accepted. ssh'ing to openhab-concole 8101 with openhab:habopen is working, too.

With fresh flashed 1.7.4b login via ssh is possble before openhab-initilaize is finished (no connection to port 8080 via browser)

bohni commented 1 year ago

I looked up the diff and found this change with the new/working password:

https://github.com/openhab/openhabian/blob/4d13f4baffe09c04629d4086711a4ec032f8ccf1/build.bash#L358

this does not match the documentation in

https://github.com/openhab/openhabian/blob/4d13f4baffe09c04629d4086711a4ec032f8ccf1/build-image/openhabian.conf#L15

nor on the website documentation

https://www.openhab.org/docs/installation/openhabian.html#passwords

bohni commented 1 year ago

https://github.com/openhab/openhabian/blob/4d13f4baffe09c04629d4086711a4ec032f8ccf1/build-image/first-boot.bash#L59

sets the username (if the car was empty, then a default is used)

that leads to

https://github.com/openhab/openhabian/blob/4d13f4baffe09c04629d4086711a4ec032f8ccf1/build-image/first-boot.bash#L68

that is a OR expression with [ -v $username ] allways being true, because the var was set before.

So the chpasswd is always skipped.

bohni commented 1 year ago

OK. Did another fresh image install on the sdcard (using Raspberry Pi Imager).

This time ssh with openhabian:openhabian did work.

mstormi commented 1 year ago

Ok. Thanks for pointing me at the change that caused this issue.