HomeHow to?How to Set Up Two-Factor Authentication in Ubuntu?

How to Set Up Two-Factor Authentication in Ubuntu?

How to Set Up Two-Factor Authentication in Ubuntu? Ubuntu is an open source operating system for computers. It is one of the distribution systems of Linux, and is based on the Debian architecture. It is usually run on personal computers, and is also popular on network servers, usually running the Ubuntu Server variant, with enterprise-class features. Ubuntu runs on the most popular architectures, including Intel, AMD, and ARM-based machines.

Ubuntu is also available for tablets and smartphones, with the Ubuntu Touch edition. Two-factor authentication (also known as 2FA) is a method of confirming a user’s claimed identity by utilizing a combination of two different components. Two-factor authentication is a type of multi-factor authentication.

Prerequisites

  • Computer System with Ubuntu OS
  • Any Two-Factor Authentication App in your Smartphone

Install Two-Factor Authentication in Ubuntu

It is really simple to install two-factor authentication application, like Google Authenticator in Ubuntu system. All you have to do is just use below command to install it.

sudo apt install libpam-google-authenticator

Configure  Ubuntu OS

Another thing after install Google Authenticator is to configure Ubuntu Linux operating system properly. For this, we need to add a codes in ‘common-auth‘ file. So, to do it, just navigate to etc > pam.d > common-auth. Open the file with any good text-editor and find following below line in it.

auth [success=1 default=ignore] pam_unix.so nullok_secure

Right above that line, add in this one:

auth required pam_google_authenticator.so

Save and close the file.

Configure Google Authenticator

So, now we need to configure Google Authenticator to use it. For this, just enter below command in your OS’s terminal.

google-authenticator

Google Authenticator will ask you few questions. According to my suggestion, answer the questions with following below answers.

After answering first question, it will generate a QR Code, Key and Codes. Copy those codes somewhere secure and then answer other questions.

How to Set Up Two-Factor Authentication in Ubuntu?
How to Set Up Two-Factor Authentication in Ubuntu?

However, you can answer these question according to your requirements as well. It all depends on you.

Don’t close the terminal.

Set Up Two-Factor Authentication in Ubuntu

Well now, you need to install some sort of Two-Factor Authentication application in your smartphone. You can install Google Authenticator App in your smartphone, but according to my suggestion, install Authy app because it is more advanced with cloud storage.

While configuring Google Authenticator in Ubuntu, after first question, it was created a QR Code with Key. Use any Two-Factor Authenticator App and Scan QR code if you can. If are not able to scan QR Code then use Key to manually input it app.

How to Set Up Two-Factor Authentication in Ubuntu?
How to Set Up Two-Factor Authentication in Ubuntu?
How to Set Up Two-Factor Authentication in Ubuntu?
How to Set Up Two-Factor Authentication in Ubuntu?

All Done. Restart your Ubuntu operating system to check its effect.

How to Set Up Two-Factor Authentication in Ubuntu?
How to Set Up Two-Factor Authentication in Ubuntu?

Please Like, Share and Comment your valuable thoughts  🙂 

Thanks for patronizing Ultimate Tech. This post is about, "How to Set Up Two-Factor Authentication in Ubuntu?" and last updated on October 2, 2017. I am sure your visit to us must be quite satisfying and in line with your expectations from us. Just in case, it’s not as you expected from us or if you are facing any problem, kindly forward your feedback’s directly to us by leaving a Comment below. And, get assured response from my side. Your feedback’s and suggestions are extremely valuable to us. This Post is written by Harman Singh Hira. There is not any source, if any, then already mentioned so Copying or using this post’s content for your own site is not allowed. If anyone do so, get ready for facing DMCA. Please, if you like this post then share on your social networking sites. Assuring you of our best service always.

Harman Singh Hira
Harman Singh Hirahttps://me.hsinghhira.me/
He is a young Blogger, Website Designer and owns his popularity to the fact that he posts genuine contents to his blog and believe in good rituals.

- Advertisement -

Worldwide News, Local News in London, Tips & Tricks

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.

Privacy Settings saved!
Privacy Settings

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. Control your personal Cookie Services here.

These cookies are necessary for the website to function and cannot be switched off in our systems.

For performance reasons, we use Cloudflare as a CDN network. This saves a cookie "__cfduid" to apply security settings on a per-client basis. This cookie is strictly necessary for Cloudflare's security features and cannot be turned off.

In order to use this website we use the following technically required cookies
  • wordpress_test_cookie
  • wordpress_logged_in_
  • wordpress_sec

Decline all Services
Accept all Services