first login password change in WEBMIN fails

When creating webmin users and setting the flag change password after first login, 80% of the systems are successful, but commonly 20% of systems fail more times than they are successful.

From within webmin, the password change functions appear to work correctly, but the end results is the user ends up with one of the following:-

  1. a 404 html error without changing the password, or more likely
  2. you receive the message "Password changing is not enabled!"

Both of there scenarios can be triggered by the webmin configuration entry 'passwd_mode=' in /etc/webmin/miniserv.conf

From the password_change.cgi script, line 12 shows:-

$miniserv{'passwd_mode'} == 2 || die "Password changing is not enabled!";

In checking the miniserv.conf file, it was noticed that the value was anything other than 2:

# grep passwd_mode /etc/wedmin/miniserv.conf
passwd_mode=0

Use your favourite text editor and change the value to 2

# grep passwd_mode /etc/wedmin/miniserv.conf
passwd_mode=2

and restarting the webmin server resolves the problem.