Two-factor authentication via Google

13 posts / 0 new
Last post
#1 Thu, 03/22/2012 - 22:14
kiteplans

Two-factor authentication via Google

Hi,

I have been working on setting up Two-factor SSH authentication via Google.

This has gotten me thinking - when I do implement this on my SSH and secure my SSH even more, this will not be of much use if I do not implement it on the Virtualmin/Webmin Login page as well?

How would I be able to work Two-factor authentication via Google into the Virtualmin/Webmin Login page?

Any suggestions or ideas would be appreciated.

Kiteplans

Fri, 03/23/2012 - 07:50
andreychek

Howdy,

That's an interesting question... what did you have to do in order to get SSH working with the two-factor authentication?

I'm curious if a similar setup to what you did there could also work for Webmin/Virtualmin, but that'll depend on what all needed done for SSH to work.

-Eric

Tue, 03/27/2012 - 02:02
kiteplans

Eric,

Sorry for only getting back to you now.

Here is what needs to be done to get it to work on SSH: http://blog.adslweb.net/serendipity/article/286/CentOS-5-enabling-Two-fa... http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/ca...

And here is a thread I found of someone who already did a hack to get it to work on Webmin...

http://forum.yubico.com/viewtopic.php?f=11&t=692

let me know what you think.

Peace

I’m a “Geek” serving as a Linux System admin, a website designer and maintainer and general know how for all things TECH. I am a fan of CentOS, Virtualmin, Joomla, and anything that uses Electricity. See more of my posts at http://www.dieskim.me

Tue, 03/27/2012 - 08:05
andreychek

Ah, great. That's good info, which also led me to some other docs on the matter.

My one last question before I go pursue this further -- once two-factor authentication is enabled in SSH -- am I correct in that it becomes a requirement for everyone?

And is that what you'd want for Webmin/Virtualmin?

Or would you like to see that configurable per-user?

I think I'd be inclined to look into a way of enabling/disabling that per-user, but I wanted your thoughts before looking into it :-)

Thanks!

-Eric

Wed, 04/04/2012 - 20:45 (Reply to #4)
kiteplans

Eric,

Have you had time to look at this more at all? How is it coming along?

Peace

I’m a “Geek” serving as a Linux System admin, a website designer and maintainer and general know how for all things TECH. I am a fan of CentOS, Virtualmin, Joomla, and anything that uses Electricity. See more of my posts at http://www.dieskim.me

Tue, 03/27/2012 - 09:46
kiteplans

Eric,

Thanks for looking into this with me.

Yes, I believe you are right about it being required by everyone on the server.

I would really want that on the virtualmin/webmin server as a requirement as with SSH as I would want the system to be secure all round, or have the added security of two-factor authentication all round, SSH and Virtualmin with all users - and not just some that have a higher/better security level due to the two-factor authentication and then others bringing the security level down due to them not having it or needing it.

Basically all I am saying is - if you want to go to the extreme of adding two-factor authentication on your server I think you would want to do it all round!

What would be your main reasons for wanting to add the feature to enable/disable that per-user? And would that be the best thing or good at all to do from a security point of view?

Looking forward to hearing from you!

Peace

I’m a “Geek” serving as a Linux System admin, a website designer and maintainer and general know how for all things TECH. I am a fan of CentOS, Virtualmin, Joomla, and anything that uses Electricity. See more of my posts at http://www.dieskim.me

Wed, 03/28/2012 - 14:35
Mick27

with duo security it can be per user.

I think I had it working per user on google authenticator, but I am not sure since I replaced it with duosecurity.

If you want to put it only for ssh you can modify the pam files for ssh, that's what I do.

Wed, 04/04/2012 - 23:40
JamieCameron

Have you managed to get SSH to use two-factor authentication with just a PAM configuration change?

If so, you could configure Webmin in the same way, by editing /etc/pam.d/webmin with the same changes you made to /etc/pam.d/sshd

Since the login process will now prompt for more than just a username and password, you would need to enable "Full PAM conversion" mode in Webmin. This can be done by editing /etc/webmin/miniserv.conf and adding the line pam_conv=1 , then running /etc/webmin/restart

''

Fri, 04/06/2012 - 09:11
kiteplans

Hey guys,

Thanks for all the help and advice - I spent the whole day on this and it now works beautifully on both SSH and Virtualmin - here is a guide I wrote...

http://kiteplans.info/2012/04/06/two-factor-ssh-virtualmin-authenticatio...

Let me know what you think - I have also added a link to the bottom to a patch that would enable you to turn this on for some users only.

I’m a “Geek” serving as a Linux System admin, a website designer and maintainer and general know how for all things TECH. I am a fan of CentOS, Virtualmin, Joomla, and anything that uses Electricity. See more of my posts at http://www.dieskim.me

Fri, 04/06/2012 - 10:50
andreychek

That's a nice writeup, thanks for sharing!

I posted a link to your blog entry in our twitter account.

-Eric

Fri, 04/06/2012 - 20:44
kiteplans

Eric,

Awesome! Thanks so much! Thats more of a Diary than a blog but there is also alot of other good Virtualmin related things!

Peace

I’m a “Geek” serving as a Linux System admin, a website designer and maintainer and general know how for all things TECH. I am a fan of CentOS, Virtualmin, Joomla, and anything that uses Electricity. See more of my posts at http://www.dieskim.me

Mon, 02/17/2014 - 08:33
abrahaj

Actually I think this feature should be built-in with Virtualmin. Would love to see it part of the next release...

Mon, 02/09/2015 - 02:24
oranjbox

Eric,

I would find the two factor feature somewhat painful if it was forcibly enabled for ALL virtualmin users.

In a production environment from my perspective I would want the main administration account(s) and SSH users to have two factor but my clients should not need to go and purchase a Yubikey or sign up with a 3rd party just to login to a service they are paying for. A choice would of users would be nice.

I'm looking at getting a Yubikey myself to use with both KeePass and my servers. I will likely look into kiteplans post regarding two factor with virtualmin if it hasn't been implemented yet.

  • Mikhael
Topic locked