Attempting to start 2 part auth with web/virtualmin on CentOS 7

I really farking hate Linux sometimes - 6 weeks without a website and it's not getting any better any time soon.

Found two similar issues several years ago and followed step by step instructions to the letter.

Most recent one http://kiteplans.info/2014/12/26/how-to-virtualmin-two-factor-google-aut...

yum --enablerepo=epel install 'perl(Moose)'

This actually went through the whole process without failing so I had hopes, but when I went back to Webmin Configuration and clicked on icon for 2FA then click on multi select drop down for Google authentication or authy I get the follow error message - still after 2 f'ing hours +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ **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. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

So I click on the "Perl Modules" link again for about the 30th time Installing Perl module Authen::OATH from package perl(Authen::OATH) .. Installing package(s) with command /bin/yum -y install perl(Authen::OATH) .. Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.confluxtech.com * epel: mirror.sfo12.us.leaseweb.net * extras: mirror.confluxtech.com * updates: mirror.confluxtech.com No package perl(Authen::OATH) available. Error: Nothing to do .. install failed! Some modules failed to install from packages, trying installation from source instead.. Downloading http://www.cpan.org/authors/id/O/OA/OALDERS/Authen-OATH-2.0.0.tar.gz (12.83 kB) .. Received 1024 bytes (7 %) Received 2 kB (15 %) Received 3 kB (23 %) Received 4 kB (31 %) Received 6 kB (46 %) Received 7 kB (54 %) Received 8 kB (62 %) Received 9 kB (70 %) Received 11 kB (85 %) Received 12 kB (93 %) Received 12.83 kB (100 %) .. download complete. Perl module install options Module name Authen::OATH 2.0.0 Source http://www.cpan.org/authors/id/O/OA/OALDERS/Authen-OATH-2.0.0.tar.gz Pre-requisites Digest::HMAC warnings Moo Types::Standard strict Test::More Math::BigInt Digest::SHA Module::Build (Missing 2 modules) Install action
Makefile.PL arguments
Makefile.PL environment variables
Name Value

blartty blartty blarrr

I go down to Continue with Install - Fetching Missing Pre-Requisites

click again

Making and installing Authen::OATH .. Untarring module file Executing gunzip -c /tmp/.webmin/Authen-OATH-2.0.0.tar.gz | tar xvf - ..

Authen-OATH-2.0.0/ Authen-OATH-2.0.0/Build.PL Authen-OATH-2.0.0/Changes Authen-OATH-2.0.0/CONTRIBUTORS Authen-OATH-2.0.0/cpanfile Authen-OATH-2.0.0/dist.ini Authen-OATH-2.0.0/INSTALL Authen-OATH-2.0.0/lib/ Authen-OATH-2.0.0/LICENSE Authen-OATH-2.0.0/Makefile.PL Authen-OATH-2.0.0/MANIFEST Authen-OATH-2.0.0/META.json Authen-OATH-2.0.0/META.yml Authen-OATH-2.0.0/README Authen-OATH-2.0.0/t/ Authen-OATH-2.0.0/t/00-load.t Authen-OATH-2.0.0/t/01-cases.t Authen-OATH-2.0.0/t/author-pod-coverage.t Authen-OATH-2.0.0/t/author-pod-spell.t Authen-OATH-2.0.0/t/manifest.t Authen-OATH-2.0.0/t/pod-coverage.t Authen-OATH-2.0.0/t/pod.t Authen-OATH-2.0.0/t/release-cpan-changes.t Authen-OATH-2.0.0/t/release-synopsis.t Authen-OATH-2.0.0/lib/Authen/ Authen-OATH-2.0.0/lib/Authen/OATH.pm Compiling module Executing /usr/bin/perl Makefile.PL && make ..

Warning: prerequisite Moo 2.002004 not found. Warning: prerequisite Types::Standard 0 not found. Checking if your kit is complete... Looks good Writing Makefile for Authen::OATH Writing MYMETA.yml and MYMETA.json cp lib/Authen/OATH.pm blib/lib/Authen/OATH.pm Manifying blib/man3/Authen::OATH.3pm Installing module Executing make install ..

Manifying blib/man3/Authen::OATH.3pm Appending installation info to /usr/lib64/perl5/perllocal.pod Make and install of Authen::OATH successful.

You have to see it also, I'm not a farking nutjob... It says "Make and Install of Authen:: OATH successful.

click on <-- Return to Webmin Configuration

Click on Two-Factor Authentication Icon

choose Google Authenticator

click save

Hold breath almost turn blue with hopes

boom

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.

Please help

Status: 
Needs work

Comments

Howdy -- sorry that you're having problems enabling two-factor auth!

What is the output of these commands:

find /usr -name OATH.pm
perl -MAuthen::OATH -e 1
ftbseobrad's picture
Submitted by ftbseobrad on Thu, 02/16/2017 - 17:38

[root@jerususalem ~]# find /usr -name OATH.pm /usr/local/share/perl5/Authen/OATH.pm +++++++++++++++++++++++++++++++++++++++++++++++ [root@jerususalem ~]# perl -MAuthen::OATH -e 1 Can't locate Moo.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/share/perl5/Authen/OATH.pm line 8. BEGIN failed--compilation aborted at /usr/local/share/perl5/Authen/OATH.pm line 8. Compilation failed in require. BEGIN failed--compilation aborted.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I followed several different suggestions that others got and I remember seeing moo.pm and there were a couple of different ways of getting the perl module targets out of the package manager but nothing I've tried has worked. Yum or bash come back and either tell me that the package doesn't exist or that the package is fully updated and there was nothing to do

I'm almost persuaded that there is a demonic gremlin in Centos 7. :-)

Should I just dump Centos 7 for Ubuntu 16.04? I'm running a dual boot Ubuntu 16.10/windows 10 on my laptop so I'm fairly familiar with Ubuntu.

I originally tried to install virtualmin on debia 8 becuause you're install video uses Debian 8 but nothing I tried to get Perl 7 going would work. That's why I switched back to Centos7 as that is what I was using when I tried to work with Plesk and Cpanel.

By the way, none of my earlier venting was aimed at Virtualmin - I've just had a hellacious struggle with a lot of issues the last 4 months and I just kind of lost it lost night.

I appreciate the help.

Another user reported dependency problems installing the Authen::OATH module from an RPM as well.

What works best is simply to run :

perl -MCPAN -e 'install Authen::OATH'

ftbseobrad's picture
Submitted by ftbseobrad on Thu, 02/16/2017 - 19:07

[root@jerususalem ~]# perl -MCPAN -e 'install Authen::OATH' Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .). BEGIN failed--compilation aborted.

It worked for the other person in the article I read but not for me.

I use a strong 12 digit pw with UC, lc, numbers and special characters so I"m not freaking on this one but it is a high priority for me to get google authenticate or authy up and running soon. The first day I had cPanel up and running I was getting brute force attacks from all over the world. cPanel has their Hulk system to beat back those attacks fortunately. I don't want to be up to long and advertising over DNS without all the protection I can get. Especially with Wordpress

Thanks Brad

ftbseobrad's picture
Submitted by ftbseobrad on Thu, 02/16/2017 - 20:25

Ive been trying to research this outside in Google but I haven't found anything. Everything I try it just tells me I have the most up to date perl and It's even telling me that the needed perl module is installed but I still get the runaround when I try to activate authy or google authenticator.

Well, just to verify, what output do you receive when running this command:

cpan -i Authen::OATH

Also, what problems are you having when trying to activate Authy or Google Authenticator?

ftbseobrad's picture
Submitted by ftbseobrad on Fri, 02/17/2017 - 15:26

Thanks for responding,

[root@jerususalem ~]# cpan -i Authen::OATH -bash: cpan: command not found

Well, I have a two pronged issue When I try to activate Authy - I go to Authy to get the api token key and come back and paste it in and it says that the key is invalid or doesn't appear to be a correct key

If I try to activate google authenticator it just keeps putting me in the loop telling me that all the modules aren't needed. I'm seriously considering just switching to Ubuntu 16.04 and trying it with that because I've had nothing but problems with Debian 8 and CentOs 7 Don't know if I'll have any better luck with Ubuntu

Try instead the command :

perl -MCPAN -e 'install Authen::OATH'

ftbseobrad's picture
Submitted by ftbseobrad on Fri, 02/17/2017 - 20:28

For a variety of reasons I've decided to give up on Centos 7 and just run Ubuntu 16.04 - I'll get back to you folks if needed - Thanks Brad

Yeah it sounded like some things were awry with Perl there, it seemed like CPAN may not have been there, but that's normally available by default.

Yeah give it a try with Ubuntu and let us know how that works for you!