Linux Tactic

Secure Your Linux Mint 21 Machine with Google Authenticator’s 2FA

Google Authenticator is a popular two-factor authentication app that increases security by requiring users to enter a time-based token or a six-letter code in addition to their password. Linux Mint 21 is a popular Linux distribution used by many individuals and organizations.

In this article, we will provide a step-by-step guide on how to install Google Authenticator on Linux Mint 21 and enable two-factor authentication.

Installing Google Authenticator on Linux Mint 21

The first step to enabling two-factor authentication is to install Google Authenticator on your Linux Mint 21 machine. The installation process is straightforward and can be done by following these simple steps:

1.

Open the Terminal on your Linux Mint 21 machine. 2.

Run the following command to install Google Authenticator:

sudo apt-get install libpam-

google-authenticator

3. Once the installation is complete, run the following command to start the setup process:

google-authenticator

4. The setup process will guide you through the following steps:

a.

Scan the QR code or manually enter the secret key into the Google Authenticator app on your mobile device. b.

Enter a verification code generated by the Google Authenticator app. c.

Choose whether to enable time-based tokens and emergency scratch codes. d.

Save the emergency scratch codes in a safe place. 5.

After completing the setup process, Google Authenticator is ready to use.

Setting up Google Authenticator

Two-factor authentication is enabled by default with time-based tokens. To use it, follow these steps:

1.

Log in to your Linux Mint 21 machine as usual. 2.

Open the Google Authenticator app on your mobile device. 3.

Enter the verification code generated by Google Authenticator. 4.

If the code is correct, you will be logged in to your Linux Mint 21 machine. Emergency scratch codes can be used to log in if you don’t have access to your mobile device or if Google Authenticator isn’t working.

To use an emergency scratch code, follow these steps:

1. Log in to your Linux Mint 21 machine as usual.

2. Enter an incorrect verification code in the Google Authenticator app on your mobile device.

3. Click on the “Enter one of your emergency scratch codes” link.

4. Enter one of the emergency scratch codes generated during the setup process.

5. If the code is correct, you will be logged in to your Linux Mint 21 machine.

Enabling 2FA on Linux Mint 21

To enable two-factor authentication on your Linux Mint 21 machine, follow these steps:

1. Open the Terminal on your Linux Mint 21 machine.

2. Edit the PAM configuration file by running the following command:

sudo nano /etc/pam.d/sshd

3.

Add the following line to the file:

auth required pam_google_authenticator.so

4. Save and exit the file.

5. Edit the PAM account configuration file by running the following command:

sudo nano /etc/pam.d/sshd

6.

Add the following lines to the file:

# skip 2FA for local connections

# or when the user is root

auth [success=1 default=ignore] pam_succeed_if.so uid >= 1000 quiet

auth sufficient pam_google_authenticator.so

auth required pam_deny.so

7. Save and exit the file.

8. Restart the SSH service by running the following command:

sudo service ssh restart

9. Two-factor authentication is now enabled.

The next time you log in, you will be prompted to enter a verification code generated by Google Authenticator.

Conclusion

Two-factor authentication is a crucial security feature that should be enabled on all devices. By following the steps outlined in this article, you can easily install Google Authenticator on Linux Mint 21 and enable two-factor authentication.

Remember to save your emergency scratch codes in a safe place in case you don’t have access to your mobile device or if Google Authenticator isn’t working. Stay safe and secure online!

One of the most important things to consider when using any device or system is security.

In today’s technology-driven world, cybercriminals are always coming up with new ways to exploit vulnerabilities in operating systems and applications. Linux Mint 21, a popular Linux distribution, is no exception.

One way to protect yourself and your data is by enabling two-factor authentication (2FA) using Google Authenticator. In this article, we will discuss the benefits of enabling 2FA and how to use Google Authenticator to secure Linux Mint 21.

Benefits of Enabling 2FA

Passwords are no longer enough to protect your devices and data. Cybercriminals can easily hack passwords using techniques like phishing, social engineering, and brute force attacks.

This is where 2FA comes into play. 2FA adds an additional layer of security to the login process, making it more difficult for cybercriminals to gain access to your system.

Even if your password is compromised, 2FA ensures that an attacker cannot access your account without the second factor, which is usually a verification code.

Using Google Authenticator

Google Authenticator is a popular 2FA app that is used by many individuals and organizations. It is easy to use and can be set up in minutes.

Here’s how to use Google Authenticator to secure your Linux Mint 21 machine:

1. Install Google Authenticator on your mobile device.

2. Open the Terminal on your Linux Mint 21 machine.

3. Install the libpam-

google-authenticator package by running the following command:

sudo apt-get install libpam-

google-authenticator

4. Run the following command to start the setup process:

google-authenticator

5. Follow the instructions to scan the QR code or manually enter the secret key into the Google Authenticator app on your mobile device.

6. Choose whether to enable time-based tokens and emergency scratch codes.

7. Save the emergency scratch codes in a safe place.

8. Once the setup process is complete, run the following command to open the PAM configuration file:

sudo nano /etc/pam.d/sshd

9.

Add the following line to the file:

auth required pam_google_authenticator.so

10. Save and exit the file.

11. Restart the SSH service by running the following command:

sudo service ssh restart

12. 2FA is now enabled.

The next time you log in to your Linux Mint 21 machine, you will be prompted to enter a verification code generated by Google Authenticator.

Conclusion

Enabling 2FA using Google Authenticator is a simple and effective way to secure your Linux Mint 21 machine. By adding an additional layer of security to the login process, you can protect your data from cybercriminals who may want to exploit vulnerabilities in your system.

Remember to save your emergency scratch codes in a safe place in case you don’t have access to your mobile device or if Google Authenticator isn’t working. Stay safe and secure online!

In summary, enabling two-factor authentication (2FA) using Google Authenticator is a crucial step in securing your Linux Mint 21 machine.

Passwords are no longer enough to protect systems and data from cybercriminals, who can exploit vulnerabilities in operating systems and applications. Enabling 2FA adds an additional layer of security to the login process, making it more difficult for attackers to gain access to your system.

By using Google Authenticator, you can easily set up and use 2FA in a matter of minutes. Remember to save your emergency scratch codes in a safe place, and stay safe and secure online!

Popular Posts