Fixing WebMin Two Factor Authentication Authen::OATH Issue
WebMin Two Factor Authen::OATH issue can be a killer for patience. After installing WebMin, you must increase security of your WebMin panel. This can be done easily by setting-up WebMin Two Factor authentication. However, this may give many different errors. One of the irritating one is Authen::OATH perl module error.
When you select “Google Authenticator” and press Next, then you may have got below error,Perl module Authen::OATH needed for two-factor authentication is not installed.
Clicking on the link “Perl Modules” will install it from source but then again there may be other dependencies errors. Like below,
Can’t locate ExtUtils/MakeMaker.pm.
If you go back to WebMin config and click the Two Factor again, then WebMin will tell you that perl module “Authen::OATH” is still missing. This will keep happening no matter how many times you try it.
Reasons are simple and can be any one or all of below,
- You are missing Perl modules like Moose, Digest or Build package.
- Authen::OATH is not being installed properly.
- You are not restarting WebMin core after OATH installation.
Last one seems very silly but it is the main problem as Authen::OATH is being installed from source and will not be detected by WebMin unless core is restarted.
Tweet this with a click and tell it to WebMin developers,#WebMin doesn't restart core after Authen::OATH source install & thus fails to detect it. Click To Tweet
Try to restart the WebMin service using SSH after Authen::OATH installation and your issue should get fixed. If not then follow the below steps to install it correctly.
Using SSH (shell), enter these commands one by one,
yum install gcc
yum install 'perl(Moose)'
yum install 'perl(Digest::HMAC)'
yum install 'perl(Module::Build)'
This will install all required perl packages for Source build and supporting WebMin Two Factor Authentication.
Now, you must pull fresh package from CPAN,
Unzip it using,
tar -xvf Authen-OATH-v1.0.0.tar.gz
Change the directory to newly extracted folder. In my case, I issued following command,
Enter these commands one by one,
service webmin restart
Now, go back and try the WebMin Configuration -> Two Factor -> Select Google Authenticator and press Next.
This should now work and WebMin should declare that is now restarting.
You can follow this amazing guide to Setup WebMin 2Fa for users.