webmin: Two-Factor Authentification does not work on CentOS 7 at all
All commands was performed from root
Result of hostnamectl
Static hostname: authen-test.cloudapp.vip
Icon name: computer-vm
Chassis: vm
Machine ID: adf9299009f744f376e4e8cc3431c2db
Boot ID: 0913c00907b34b54a44a25129d6a6110
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1127.10.1.el7.x86_64
Architecture: x86-64
When I select Google Authentificator in Two-Factor Authentication, I always get this error:
Failed to save two-factor authentication : The Perl module Authen::OATH needed for two-factor authentication is not installed. Use the Perl Modules page in Webmin to install it.
OK, it shows me to install module. However it installs module but this does not change anything.
/etc/init.d/webmin restartafter it does not give anything
Method with MCAP also does not work:
yum -y install gcc
yum -y install perl-CPAN
perl -MCPAN -e "install Test::Moose"
perl -MCPAN -e "install Types::Standard"
perl -MCPAN -e "install Moo"
perl -MCPAN -e "install Authen::OATH"
perl -e 'use Authen::OATH;'
I have googled all solutions but they does not work. For example, I have tried various solutions and they all does not work, for example: https://www.virtualmin.com/node/43279 https://www.orangecoat.com/how-to/duo-security-and-webmin-virtualmin-two-factor-authentication-login-integration
Maybe something wrong with package? No, 5 days of building rpm packages of new version of Authen::OATH lead to absolutely nothing!!!
New packages but the same error!
mkdir -p /root/Authen/
cd /root/Authen/
wget -i https://scripts.s3.dtln.ru/linklist.txt
rm -f linklist.txt
rpm -Uvh http://repo.openfusion.net/centos7-x86_64/openfusion-release-0.7-1.of.el7.noarch.rpm
yum localinstall *.rpm --skip-broken
## perl-IO-Pager is problematic. It requires /usr/local/bin/perl for some reason!
rpm -i --nodeps perl-IO-Pager-2.10-1.el7.noarch
And this does not work!
If you need logs, you can take all the logs you need. VM is still active, I can add you public key. If you can’t fix this, please change 2FA solution for Google Authenticator to another one!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17
Gavin, now it works just flawlessly. Thank you very much!
For the future reference, and anyone wanting to setup Google Authenticator for Webmin on CentOS 6, 7 or 8 (by installing missing
perl-Authen-OATHwithout compiling missing Perl modules), simply install Gavin Carr’s Open Fusion RPM Repository.rpmfile (CentOS 6 link, 7 link, 8 link) runyum cleanafterwards and go to Webmin to install everything automatically.As well, using console it could be done as follows.
CentOS 6
CentOS 7
CentOS 8
@gavincarr Gavin, perhaps adding additional repo file to link to the latest repo release, like
openfusion-release-latest.of.el8.noarch.rpm, could help for references from a distant future.