Secure Webmin with Google Authenticator

This post will show you how to secure Webmin with Google Authenticator in Ubuntu 14.04 Server.

NTP Time Sync

First install NTP so the time can be synchronised, the time needs to be very accurate so Google Authenticator can work.

Sync the NTP service with a pool before starting the service. The second line is an example of the output of the command.

Start the NTP service. The service should have been added as a startup script.

Google Authenticator Install/Setup

Now we need to install the Google Authenticator application and generate the keys.

The application may pull in a few dependencies but just accept.

Run the command below:

Now you will need to answer some questions. These are shown below. I have shown my answers but you may want to answer them differently.

After answering a second question a bar code is printed out on-screen, you can use this to add the device to the Google Authenticator app on your phone.

Integrate with Webmin

Edit the following file:

Add this line into the file:

The file should now look like this:

Enable Full Pam Conversion mode by editing the following file:

Add this line

Now restart the webmin service.

When you login to Webmin you should be greeted with this:

References

How to Secure SSH with Google Authenticator’s Two-Factor Authentication | How To Geek
How To: CentOS Two-factor SSH and Virtualmin Authentication via Google-Authenticator | Kiteplans.info

Please share 🙂