Can only login to web UI as root on Debian 11 Bullseye

With MineOS installed on Debian 11 following these instructions:

It installs OK, and runs OK, but you can only log into the web UI as root. Any other valid user fails and redirects back to the login page.

If you run webui.js manually so that you can see stderr, it prints this when trying to login as non-root:

Unsuccessful login attempt for username: <username>

But this error is not written to /var/log/mineos.log

Any idea what’s going on?

As I was running into the same issue, I came across this issue in the open issue list:

It seemed like the hashing algo on Debian 11 is not recognized by the current mineOS implementation

Debian 11 switched from using a sha512 hash algorithm to yescrypt. MineOS uses sha512 to hash the passwords passed from the webui login and compares it with the shadow hash in /etc/shadow. Since the way the passwords are hashed is different, the hashes won’t be the same, not letting you log in. You could either change the method which mineos uses to hash from sha512 to yescrypt, or do the easier option, changing the hash method for PAM. To change PAM’s hash method, run sudo nano /etc/pam.d/common-password. Change the line that says password [success=1 default=ignore] obscure yescrypt by replacing yescrypt to sha512. Save the file and exit. Now change all of your user passwords with passwd and that should fix the problem.