Unable to change password in openhabian-config

I just did a fresh Openhabian install of openHAB 2.5.0-1 on a Raspberry Pi3 with Raspbian Buster. Java Zulu8.40.0.178-CA-linux_aarch32hf (build 1.8.0_222-b178)

As soon as the install was done I tried to update the system password using openhabian-config. Entered the default and the new password and it said “:password successfully set for:” This made me suspicious as I have seen this problem before. I checked and the password had not been changed.

I am able to change the system password using the passwd command, and it survives a reboot, so I do not think I have a problem with the SD card.

As mentioned I had this same problem a year ago and was able to fix with “sudo mount -rw -o remount /”. Tried that this time and the command executed but it did not help.

The same problem also applies to changing Samba passwords. I did not check the others.

I was able to complete the setup and openHAB seems to be operating normally but I am concerned that whatever is causing this may be causing other problems as well that I have not noticed yet.

Any suggestions appreciated.

When logged in as your system user you should be able to change that user’s password by using the passwd command. It will prompt for the existing password and then the new one twice.

Hi Bruce. Yes the passwd command works. My question is what is causing the openhabian-config password change process to not work and what else may that be affecting?

Not likely anything else affected. There should probably be a GitHub issue filed for @mstormi or one of the other developers to resolve the issue.

Add a “set -x” to the change_password() function in /opt/openhabian/functions/passwords.bash to see what happens.
If I was to guess you ignored that it has to have 10 chars.

1 Like

Hi Markus. I tested a password less than 10 characters and it would not accept it. Here is the result after adding set -x:

2020-01-13_17:25:56_GMT [openHABian] Checking for root privileges... OK
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Ign:2 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:3 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Hit:4 http://raspbian.raspberrypi.org/raspbian buster InRelease
Fetched 6,051 B in 7s (832 B/s)
Reading package lists... Done
2020-01-13_17:26:14_GMT [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2020-01-13_17:26:14_GMT [openHABian] openHABian configuration tool version: [master]v1.5-541(5158a5f)
2020-01-13_17:26:15_GMT [openHABian] Checking for changes in origin... OK
+ introtext='Choose which services to change passwords for:'
+ failtext='Something went wrong in the password change process. Please report this problem in the openHAB community forum or as a openHABian GitHub issue.'
+ matched=false
+ canceled=false
+ allAccounts=("Linux system" "openHAB Console" "Samba" "Amanda backup")
+ FAILED=0
+ whipParams=(--title "Change password function" --ok-button "Execute" --cancel-button "Back" --checklist "$introtext" 14 90 6)
+ whipParams+=("Linux system" "Account; \"$username\" used for login to this computer" off)
+ whipParams+=("openHAB Console" "Remote console account; \"openhab\" for manage openHAB" off)
+ whipParams+=("Samba" "Fileshare account; \"$username\" for configuration files" off)
+ whipParams+=("Amanda backup" "User account; \"backup\" to handle openHAB backups" off)
+ '[' -f /etc/nginx/.htpasswd ']'
+ '[' -f /etc/influxdb/influxdb.conf ']'
+ '[' -f /etc/grafana/grafana.ini ']'
+ '[' -n 1 ']'
++ whiptail --title 'Change password function' --ok-button Execute --cancel-button Back --checklist 'Choose which services to change passwords for:' 14 90 6 'Linux system' 'Account; "openhabian" used for login to this computer' off 'openHAB Console' 'Remote console account; "openhab" for manage openHAB' off Samba 'Fileshare account; "openhabian" for configuration files' off 'Amanda backup' 'User account; "backup" to handle openHAB backups' off
+ accounts=
+ exitstatus=0
+ '[' 0 = 0 ']'
+ '[' false = false ']'
+ '[' false = false ']'
++ whiptail --title 'Authentication Setup' --passwordbox 'Enter a new password: ' 15 80
+ passwordChange=Newtestpassword
+ [[ 0 == 1 ]]
+ '[' '!' 15 -ge 10 ']'
++ whiptail --title 'Authentication Setup' --passwordbox 'Please confirm the new password:' 15 80
+ secondpasswordChange=Newtestpassword
+ [[ 0 == 1 ]]
+ '[' Newtestpassword = Newtestpassword ']'
+ '[' -n Newtestpassword ']'
+ matched=true
+ '[' true = false ']'
+ [[ '' == *\L\i\n\u\x\ \s\y\s\t\e\m* ]]
+ [[ '' == *\S\a\m\b\a* ]]
+ [[ '' == *\o\p\e\n\H\A\B\ \C\o\n\s\o\l\e* ]]
+ [[ '' == *\A\m\a\n\d\a\ \b\a\c\k\u\p* ]]
+ [[ '' == *\N\g\n\i\x\ \H\T\T\P\/\H\T\T\P\S* ]]
+ [[ '' == *\I\n\f\l\u\x\D\B* ]]
+ [[ '' == *\G\r\a\f\a\n\a* ]]
+ '[' -n 1 ']'
+ '[' 0 -eq 0 ']'
+ whiptail --title 'Operation Successful!' --msgbox 'Password successfully set for: ' 15 80
+ '[' 0 -ne 0 ']'
+ true
+ show_main_menu
+++ get_git_revision
+++ local branch shorthash revcount latesttag
++++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
+++ branch=master
++++ git -C /opt/openhabian log --pretty=format:%h -n 1
+++ shorthash=5158a5f
++++ git -C /opt/openhabian log --oneline
++++ wc -l
+++ revcount=541
++++ git -C /opt/openhabian describe --tags --abbrev=0
+++ latesttag=v1.5
+++ echo '[master]v1.5-541(5158a5f)'
++ whiptail --title 'Welcome to the openHABian Configuration Tool [master]v1.5-541(5158a5f)' --menu 'Setup Options' 21 116 14 --cancel-button Exit --ok-button Execute '00 | About openHABian    ' 'Information about the openHABian project and this tool' '' '' '01 | Update' 'Fetch the latest revision of the openHABian Configuration Tool' '02 | Upgrade System' 'Upgrade all installed software packages to their newest version' '03 | openHAB Stable' 'Install or upgrade to the latest stable release of openHAB 2' '' '' '10 | Apply Improvements' 'Apply the latest improvements to the basic openHABian setup ►' '20 | Optional Components' 'Choose from a set of optional software components ►' '30 | System Settings' 'A range of system and hardware related configuration steps ►' '40 | openHAB related' 'Switch the installed openHAB version or apply tweaks ►' '50 | Backup/Restore' 'Manage backups and restore your system ►' '60 | Manual/Fresh Setup' 'Go through all openHABian setup steps manually ►' '' '' '99 | Help' 'Further options and guidance with Linux and openHAB'
+ choice=
+ RET=1
+ '[' 1 -eq 1 ']'
+ return 255
+ system_check_default_password
+ introtext='The default password was detected on your system! That'\''s a serious security concern. Others or malicious programs in your subnet are able to gain root access!
  \nPlease set a strong password by typing the command '\''passwd'\''!'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2020-01-13_17:26:53_GMT [openHABian] Checking for default openHABian username:password combination... '
2020-01-13_17:26:53_GMT [openHABian] Checking for default openHABian username:password combination... + is_pi
+ is_pizero
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]09[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pizerow
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[cC][0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pione
+ grep -q '^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$' /proc/cpuinfo
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[0-36][0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pitwo
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]04[0-9a-fA-F]$' /proc/cpuinfo
+ return 0
+ return 0
+ id -u pi
+ is_pi
+ is_pizero
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]09[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pizerow
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[cC][0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pione
+ grep -q '^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$' /proc/cpuinfo
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[0-36][0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pitwo
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]04[0-9a-fA-F]$' /proc/cpuinfo
+ return 0
+ return 0
+ USERNAME=openhabian
+ PASSWORD=openhabian
+ id -u openhabian
++ grep -w openhabian /etc/shadow
++ cut -d: -f2
+ ORIGPASS='$6$Mz5cuvcdhtHtwFvX$0mWd/5rKp4Ctn5Em7u3g/ea8iU5jf1E9oY.kFiYG1HMX0y7H5EDvEn1wuhRLF.h5d8oG46C/umvZHPmAQBjao0'
++ echo '$6$Mz5cuvcdhtHtwFvX$0mWd/5rKp4Ctn5Em7u3g/ea8iU5jf1E9oY.kFiYG1HMX0y7H5EDvEn1wuhRLF.h5d8oG46C/umvZHPmAQBjao0'
++ cut '-d$' -f2
+ ALGO=6
++ echo '$6$Mz5cuvcdhtHtwFvX$0mWd/5rKp4Ctn5Em7u3g/ea8iU5jf1E9oY.kFiYG1HMX0y7H5EDvEn1wuhRLF.h5d8oG46C/umvZHPmAQBjao0'
++ cut '-d$' -f3
+ SALT=Mz5cuvcdhtHtwFvX
+ export PASSWORD ALGO SALT
++ perl -le 'print crypt("$ENV{PASSWORD}","\$$ENV{ALGO}\$$ENV{SALT}\$")'
+ GENPASS='$6$Mz5cuvcdhtHtwFvX$0mWd/5rKp4Ctn5Em7u3g/ea8iU5jf1E9oY.kFiYG1HMX0y7H5EDvEn1wuhRLF.h5d8oG46C/umvZHPmAQBjao0'
+ '[' '$6$Mz5cuvcdhtHtwFvX$0mWd/5rKp4Ctn5Em7u3g/ea8iU5jf1E9oY.kFiYG1HMX0y7H5EDvEn1wuhRLF.h5d8oG46C/umvZHPmAQBjao0' == '$6$Mz5cuvcdhtHtwFvX$0mWd/5rKp4Ctn5Em7u3g/ea8iU5jf1E9oY.kFiYG1HMX0y7H5EDvEn1wuhRLF.h5d8oG46C/umvZHPmAQBjao0' ']'
+ '[' -n 1 ']'
+ whiptail --title 'Default Password Detected!' --msgbox 'The default password was detected on your system! That'\''s a serious security concern. Others or malicious programs in your subnet are able to gain root access!
  \nPlease set a strong password by typing the command '\''passwd'\''!' 12 70
+ echo FAILED
FAILED
++ timestamp
++ date +%F_%T_%Z
+ echo -e '2020-01-13_17:26:55_GMT [openHABian] We hope you got what you came for! See you again soon ;)'
2020-01-13_17:26:55_GMT [openHABian] We hope you got what you came for! See you again soon ;)

Did you actually select any of the users ? Move cursor and press space I mean ?
Log trace does not look like you did.

Did you manually install openHABian on buster or did you use the Pi image ?

Ha! Stupid user error! I had scrolled the red cursor but did not realize I had to use the space bar to select.

Thanks!

3 Likes