How to Generate Two-Factor Authentication Code from Your Linux Desktop

Two Factor Authentication Generator Linux Featured1

Two-factor authentication (2FA) is quickly becoming the norm when it comes to signing in to popular websites and apps. It’s a good thing, too, because passwords are a terrible way to protect your account. Most people don’t know how to make secure ones, and even when they do, there’s always the chance of a security breach.

The traditional way of obtaining a 2FA code is via an authenticator app in your phone. A lot of people would rather not rely on their phone or another external device to sign in to their favorite sites on their Linux desktop, though. There’s a great solution in the form of a fairly new desktop application, Authenticator, that allows you to generate your two-factor codes right on Linux.

Install Authenticator with Flatpak

Because Authenticator is fairly new, there are only two ways to install it: compile it from source or use Flatpak. Flatpak is obviously the easiest route and the most universal.

Install Flatpak

If you don’t already have it, begin by installing Flatpak on your computer.


sudo apt install flatpak


sudo dnf install flatpak

Arch Linux

sudo pacman -S flatpak

Install Authenticator

Now that you have Flatpak installed and ready to be used, you can set up Flathub and download and install Authenticator.

flatpak remote-add --if-not-exists flathub
flatpak install flathub com.github.bilelmoussaoui.Authenticator

Wait for Flatpak to pull in everything and install. It shouldn’t take long.

Add an Application

Launch Authenticator

Authenticator is a GTK application written in Python. You’ll find it listed and available to launch from your desktop’s application menu. Go head and launch it. If you don’t see Authenticator listed, you’ll need to log out and log back in or restart your computer.

Start Authenticator

The default screen is just a big blank space that tells you to add an account.

Add an Account

Click the big plus button at the top of the window. A new window will pop open to allow you to enter the information about your account.

Authenticator Account List

Select the account from the gigantic list of available services.

Authenticator Account Filled In

Fill in your account login info and the token that you received when setting up two-factor with that account. When you’re done, press the button to add your account.

Authenticator Account Added

Finally, you’ll see your account listed on the main page with a randomly-generated code next to it. That code will update periodically for security.

Following this guide, you’ll now be able to generate your two-factor codes right on your Linux desktop. The interface is fairly simple, and you can update your existing accounts and add new ones at any time.

As you can see, this app works with way more sites and apps than you could ever need, so you shouldn’t have a hard time finding support for the sites you use most.

Image credit: CryptoCard two factor

Nick Congleton
Nick Congleton

Nick is a freelance tech. journalist, Linux enthusiast, and a long time PC gamer.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox