If you experience any difficulty in accessing content on our website, please contact us at 1-866-333-8917 or email us at support@chicagovps.net and we will make every effort to assist you.

By
February 19, 2025

Enhancing Security: A Step-by-Step Guide to Setting Up 2FA for Linux Desktop Logins

 

Adding an extra layer of security to your Linux desktop is a straightforward process. Enabling two-factor authentication (2FA) for desktop logins enhances security by requiring not just a password but also a six-digit code generated by an authenticator app on your phone.

How to Set Up 2FA on Linux

Before you start, consider testing this setup on a non-essential system to avoid being locked out of your main desktop.

Requirements

  • A running instance of a Linux distribution (the following instructions will use Zorin OS, an Ubuntu-based distribution).
  • An authenticator app such as Authy or Google Authenticator.

Steps to Install and Configure 2FA

  1. Open Your TerminalLog into your Linux distribution and open the terminal.

  2. Install Google AuthenticatorRun the following command to install the software:

    sudo apt-get install libpam-google-authenticator -y
  3. Configure the LoginOpen the common authentication configuration file:

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

    Append this line at the bottom of the file:

    auth required pam_google_authenticator.so

    Save and exit.

  4. Run Google AuthenticatorIn the terminal, execute:

    google-authenticator

    A QR code will appear. Scan this code with your authenticator app to link it to your account. Follow the prompts, ensuring you save any "scratch" codes provided for emergencies.

  5. Reboot the SystemRestart your computer. Upon login, you will need both your user password and the six-digit code from the authenticator app.

Important Notes

  • This setup applies only to desktop logins. SSH login configurations will differ.
  • Ensure your device remains secure, and consider testing this process in a controlled environment to avoid complications.

With these steps, your Linux desktop will have an added level of security. For additional guides, check out these resources on how to choose the right Linux distribution or explore lightweight Linux distributions that can rejuvenate older PCs.


ChicagoVPS is your gateway to unparalleled hosting solutions. Our state-of-the-art datacenters and powerful network ensures lightning-fast speeds and uninterrupted connectivity for your websites and applications. Whether you’re a startup looking for scalable resources or an enterprise in need of enterprise-grade hosting, our range of plans and customizable solutions guarantee a perfect fit. Trust in ChicagoVPS to deliver excellence, combining unmatched reliability and top-tier support.

For Inquiries or to receive a personalized quote, please reach out to us through our contact form here or email us at sales@chicagovps.net.

Subscribe Email

Top