Added two-factor authentication, i think last access, but not 100%. Anyway, 2fa is failing about Authen::OATH

If I install CPAN OATH, it will let me log in.

Iā€™m more interested to see the output of:

perl -I/usr/libexec/webmin/vendor_perl -e "use Authen::OATH;"

ā€¦ before anything from CPAN is installed. Could you do that for me?

No return. i put a space between the -I and /usr and still nothing.

Still locate:
[tom@mail ~]$ sudo locate OATH
/usr/libexec/usermin/vendor_perl/Authen/OATH.pm
/usr/libexec/webmin/vendor_perl/Authen/OATH.pm

[tom@mail ~]$ sudo perl -I/usr/libexec/webmin/vendor_perl -e ā€œuse Authen::OATH;ā€
[sudo] password for tom:
[tom@mail ~]$ sudo locate OATH
/usr/libexec/usermin/vendor_perl/Authen/OATH.pm
/usr/libexec/webmin/vendor_perl/Authen/OATH.pm
[tom@mail ~]$ sudo perl -I /usr/libexec/webmin/vendor_perl -e ā€œuse Authen::OATH;ā€
[tom@mail ~]$

If there is no output it means that everything is working as expected.

However, you say it donā€™t? What exactly happens if you go to Webmin ā‡¾ Webmin Configuration: Two-Factor Authentication page, select Google Authenticator and hit save. What exact error do you get? Can you provide screenshots?

Warning!
Two-factor authentication failed : Missing Perl module Authen::OATH
Webmin
Two-factor authentication has been enabled for this user to login

Token

I canā€™t login.

Can I disable 2fa via command line?

From my other server ā€œns1ā€:
[tom@ns1 ~]$ perl -I/usr/libexec/webmin/vendor_perl -e ā€œuse Authen::OATH;ā€
[tom@ns1 ~]$ perl -I /usr/libexec/webmin/vendor_perl -e ā€œuse Authen::OATH;ā€
[tom@ns1 ~]$ sudo locate OATH
[sudo] password for tom:
/usr/libexec/webmin/vendor_perl/Authen/OATH.pm
[tom@ns1 ~]$

This one is working with 2fa.

Could there be a conflict between:
/usr/libexec/usermin/vendor_perl/Authen/OATH.pm
/usr/libexec/webmin/vendor_perl/Authen/OATH.pm

Because i am not using usermin on my ns1 and ns2 hosts.

[tom@ns1 ~]$ sudo locate OATH
[sudo] password for tom:
/usr/libexec/webmin/vendor_perl/Authen/OATH.pm

Here is /var/log/messages from past wheneverā€¦
messages.log (1.2 MB)

Iā€™m going to have to change my DNS for a domain if canā€™t access the control panel, so I will probably just install CPAN to get that done if there isnā€™t a prompt resolution. I need an email address set up which I canā€™t do without Webmin access but I could do alternatively by using my host MX.

I would expect to have had questions about actual code references for why this isnā€™t working. At least a comparison of Perl scripts. There is obviously a call that is bad in the web coding for 2fa. Which files can I send you to compare?

I could do the code analysis, but I bought the premium support so I donā€™t have to.

If you apply this patch how does the actual error message looks like? Can I see the screenshot?

I can now also see that we havenā€™t removed perl-Authen-OATH package from the Virtualmin repos!

@Joe, you should remove perl-Authen-OATH package from the Virtualmin repos because this Perl package is bundled with Webmin.

If the package causes problems, then itā€™s a bug (in Webmin, not the repo). It should never be a problem to also have a package installed of a given Perl module.

Itā€™s not causing any issues! Itā€™s simply redundant.

@tommack can you try applying this patch : Show full error if Authen::OATH cannot be loaded Ā· webmin/webmin@2e8000d Ā· GitHub

Then try logging in again, and post the full error message you get, which should show more details about why twofactor is failing.

@Jamie, $@ wonā€™t be printed as part of <pre></pre> from your latest patch! Besides, it wonā€™t look nice with the new bubble in error messages. We would need to capture $@ immediately.
Anyway, I have fixed all of that in the latest patches, and also fixed a few minor bugs I introduced some time ago. Now, if a new $main::error_last_eval is set, then error() function will display a nice HTML accordion and will include the full error message, e.g.:

If $main::error_last_eval isnā€™t set explicitly then the file and line (this time correctly) will be shown in the bubble, e.g.:

@tommack Donā€™t apply any of the patches we mentioned recently. Itā€™s just too much to apply. Instead, you can try this devel build of Webmin which would include all recent changes.

Please let us know which error message do you see then by sharing a screenshot.

OK, so we are all in agreement, I will install the RPM posted above?
I have not touched the system since I did the restore.

Donā€™t install perl-Authen-OATH packageā€¦ Just upgrade with the devel Webmin package suggested above. Then go to Webmin Configuration / 2FA page and try to activate it, and then post the error.

Installed, still getting:
Warning!
Two-factor authentication failed : Missing Perl module Authen::OATH

Here is the log from the install:
webminins.zip (1.7 KB)

What is the output of webmin -v command?

Failed to open /etc/webmin/miniserv.conf

Sorry forgot to sudo:

2.102

There were def problems with the install.