To change the OpenHab Console password, you have to edit the /userdata/etc/users.properties file.
Click to Read More
First, open a SSH console on your Synology as root (See here).
Then, create a hashed password with the following command (replace ThisIsMyNewPassword with yours) :
echo -n ThisIsMyNewPassword | sha256sum
It should output someting like this :
8fda687cf4127db96321c86907cbea99dabb0b13aa4bf7555655e1df45e41938 -
If you installed openHab as explained here, the file to be edited is /openHAB/userdata/etc/users.properties in the share /SmartHome of your Synology. Copy the hashed string above (without the dash and the blank) between the {CRYPT} tags:
# This file contains the users, groups, and roles.
# Each line has to be of the format:
#
# USER=PASSWORD,ROLE1,ROLE2,...
# USER=PASSWORD,_g_:GROUP,...
# _g_\:GROUP=ROLE1,ROLE2,...
#
# All users, groups, and roles entered in this file are available after Karaf startup
# and modifiable via the JAAS command group. These users reside in a JAAS domain
# with the name "karaf".
#
openhab = {CRYPT}8fda687cf4127db96321c86907cbea99dabb0b13aa4bf7555655e1df45e41938{CRYPT},_g_:admingroup
_g_\:admingroup = group,admin,manager,viewer,systembundles
To test the new password, open a SSH console on openHab. As by default it may only be accessed from the localhost, the best option is to use GateOne (See here). Once logged in GateOne on your Synology, execute :
ssh -p 8101 openhab@localhost
You should be prompted to enter your password and, if correct, you will see:
Type Ctrl-D to exit the openHab console.
NB.: instead of logging in GateOne as admin, you can directly connect on openHab using the port ‘8101’ and the login ‘openhab’ in GateOne:
Leave a Reply