SYSTEM INFORMATION
OS type and version
Ubuntu Linux 22.04.4
Usermin version
2.102
Virtualmin version
7.20.2
Theme version
21.20.7
Apache version
2.4.52
Package updates
42 package updates are available
Hello, I wanted to activate double authentication for email users but I get the following error. I verify that Google Authenticator was already installed
manuch
November 8, 2024, 11:13pm
2
I’m having the exact same issue, on Ubuntu 24.04. Any news?
I just tried on Rocky and works fine, I noticed first post has alot of packages that need updating, can you make sure you system is updated as well.
Check here
opened 04:36PM - 30 Oct 24 UTC
closed 04:24AM - 31 Oct 24 UTC
I don't know if this is already fixed in the development version, so I'm reporti… ng it "in case you haven't previously encountered the bug", based on what's available in the stable versions in your Debian 12 repositories (Usermin 2.102 running on top of Webmin 2.202 + Virtualmin 7.20.2).
---
## Steps to reproduce
Following the instructions from [this forum thread](https://forum.virtualmin.com/t/how-to-set-up-2fa-for-usermin-and-virtualmin-users/113935/5), 2FA was already enabled in "Webmin / Usermin Configuration", however the module was not activated in "Available Modules" in "Webmin / Usermin Configuration", so I enabled that, and restarted usermin.
Then in my webmail usermin panel, I went to "Login > Two-Factor Authentication" and tried to enable it, and got this confusing error page, with this error message:
> Enrolling for two-factor authentication with provider Google Authenticator ..
> .. complete. Your ID with this provider is [some presumably secret ID].
>
> `HTTP/1.0 500 Perl execution failed Server: MiniServ/2.102 Date: Wed, 30 Oct 2024 15:39:34 GMT Content-type: text/html; Charset=utf-8 Connection: close `
> `Error — Perl execution failed`
>
> Undefined subroutine `&twofactor::can_generate_qr` called at `twofactor-funcs-lib.pl` line 235.
![image](https://github.com/user-attachments/assets/949abb53-12c3-42e7-b2fd-e5b04bce737e)
## Analysis and potential solutions
It first claims to have succeeded, then fails (and if I leave and re-enter that page, it seems to not have been enabled, thankfully).
As I understand it, it failed to generate a QR code because of a missing dependency? But as a user, I don't know what to do with this, as I don't have a QR code or clear instructions of what to do with my authenticator app to add this (can I just input that "ID" text string into my auth app? What parameters should I use? etc.)
Ideally, it should:
1. ensure any such dependency is installed by virtualmin/webmin by default, and/or when you enable the feature
2. double-check for the presence of that subroutine before applying the changes to the user in usermin, to avoid any potential of locking them out
3. check that the user is actually capable of generating the matching TOTP codes before fully enabling and enforcing it (if it doesn't already do that)
manuch
November 9, 2024, 10:24pm
4
Thank you for the link, which shows that it does indeed seem to be a bug. In Virtualmin it works, in Usermin it doesn’t. All my packages are updated and it’s a fresh install I just set up yesterday.
Yeah, the updated code is listed in links, you could check against whats on your system.
manuch
November 10, 2024, 8:04pm
6
I just saw. I am on Webmin 2.202 / Usermin 2.102, no idea when that commit will be pushed to the repo that I’m using. How would I see that? I’m sorry, I’m not very familiar with the logic that is used by Virtualmin maintainers to push out updates.
It already is , it is pushed to the GitHub repo, but this does not translate into an immediately available update for usermin/virtualmin/webmin
There are no fixed dates/times when Webmin and Virtualmin updates are pushed out to end users.
There are ways if you are a developer to update your local code, but for you I would not recommend these.
jimr1
November 11, 2024, 11:17am
8
shoulders:
There are ways
What is wrong with using the webmin patch
command ? I think this option was designed for non tech users to update webmin with code committed to the github repro directly however you do need to know the commit id
he comes across as this is not his thing, so why don’t you post the full patch info and tell how to do it and let him decide.
jimr1
November 11, 2024, 11:32am
10
As I don’t use 2fa I have no use for it, and perhaps I have better things to do with my time than hunting for the correct commit
Ilia
November 11, 2024, 11:47am
11
This issue has been fixed for the upcoming Usermin release. For those who feel comfortable, there’s also a nightly build of Usermin available that addresses this issue.
2 Likes