How to install double authentication in our Ubuntu

ssh

Ubuntu's security is something that many users worry about. To the point that many of them change the operating system or disconnect the computer from the Internet to be more secure. However, there are many alternatives to have a safe system, without leaving Ubuntu or disconnecting it from the Internet. Alternatives like double authentication, something increasingly useful and used in operating systems.

To install or use double authentication in our Ubuntu we will only need a mobile with Android and a computer with Ubuntu.

On the one hand, on the smartphone we will use an official Google app called Google Authenticator. This app will help us to use the smartphone as an unlocking key for certain operations, as the online banking applications currently work.

Google Authenticator Installation

Once we have installed the app, we have to configure our Ubuntu to work with the app on our smartphone. So first we open a terminal and write the following:

sudo apt install libpam-google-authenticator

Google Authenticator Settings

After the installation of this package, we have to configure an Ubuntu configuration file for communication with this program. To do this we write in the terminal:

sudo gedit /etc/pam.d/common-auth

And we have to look for the line "auth [success = 1 default = ignore] pam_unix.so nullok_secure”, To add the following code just above the line:

auth required pam_google_authenticator.so

Save and close the file. Now we have to run the google-authenticator program with each user on the system, since if we do not do it, the user who does not have it will not be able to log in and therefore their account will be restricted. When we do, we restart the computer and Ubuntu will ask us for a code that will be issued by our smartphone, we enter it and then the computer will be unlocked. Such a double authentication system will be effective not only for our login system but also also for passwords like root.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Unknown said

    It's disgusting, if we want Ubuntu it is obvious that we do not have a cell phone.