Skip to content
MultiloginHelp Center

How to enable 2FA in Multilogin CLI

How can 2-factor authentication help me?

2-factor authentication (2FA) adds one more layer to your login process, but it’s worth it. It helps protect your account even if someone steals your password. When trying to sign in, after you type in your password, you’ll also need to enter a code from your phone or app: even if someone knows your password, they still can’t get in, making it way harder to hack.

➡️ To enable 2FA with CLI, sign in to CLI → run enable-2fa --device <name> → scan the generated QR code → enter the authenticator code → save your backup codes.

Terminal running Multilogin CLI login and prompting for a verification code.
Whenever a user tries to sign in with login credentials, they will first be required to pass an extra layer of verification.

How to enable 2FA

Before using 2FA commands, use xcli login to get yourself a token. Failure to sign in before performing 2FA tasks will cause token errors.

Launch CLI

Launch Multilogin, then open Command Prompt or Terminal, go to the CLI folder and run CLI executable:

Windows

  1. Go to the CLI folder:
    C:/Users/%username%/mlx/deps/cli
  2. Run xcli.exe

macOS

  1. Go to the CLI folder:
    /Users/%username%/mlx/deps/cli
  2. Run ./xcli:
    ./xcli

Linux

  1. Go to the CLI folder:
    /home/%username%/mlx/deps/cli
  2. Run ./xcli:
    ./xcli

Follow the article for more details: How to start working with CLI.

Sign in to authenticate

In order to get your 2FA key, you will need to first sign in to your account via the login command.

Paste this command: xcli login --username your username --password your password:

Windows

  1. Paste this prompt to sign in: 
    xcli login --username 'your username' --password 'your password'
  2. Replace values of the flags  (--username and --password) with your email and password
Windows Command Prompt showing a successful Multilogin CLI login.

macOS

  1. Paste this prompt to sign in: 
    ./xcli login --username 'your username' --password 'your password'
  2. Replace values of the flags  (--username and --password) with your email and password
macOS Terminal showing a successful Multilogin CLI login.

Linux

  1. Paste this prompt to sign in: 
    ./xcli login --username 'your username' --password 'your password'
  2. Replace values of the flags  (--username and --password) with your email and password
Ubuntu terminal showing a successful Multilogin CLI login.

Enable 2FA for the user

If you wish to activate 2FA for the current user in Multilogin CLI:

  1. Enter xcli enable-2fa --device devicename
    • devicename → choose the name it will appear in the 2FA application

Windows

xcli enable-2fa --device devicename

macOS/Linux

./xcli enable-2fa --device devicename
  1. Once the command is parsed, the CLI tool will automatically generate a QR code
Multilogin CLI enable-2fa command displaying a QR code and prompting for an authentication code.
  1. Open your desired authenticator app (such as Google Authenticator, Microsoft Authenticator)
  2. Choose to add a new QR code and scan the output → this will create an entry in your authenticator app called MLX
    • Note: if you already have an authenticator input called MLX, you will be prompted to choose a new name
  3. Find the code shown in your authenticator → type it into the code area

Once done, you will see a success message.

Enable 2FA for the workspace

Want to activate the use of 2FA for all users in the workspace, instead of just your own? Follow the steps below:

  1. Make sure you have completed all the steps to enable 2FA in the previous section
  2. Enter xcli enable-2fa-for-workspace  

Windows

xcli enable-2fa-for-workspace

macOS/Linux

./xcli enable-2fa-for-workspace

How to disable 2FA

Disable 2FA for the user

Disabling 2FA is even easier than enabling it! Just enter xcli disable-2fa-for-user and that's it! No flags needed. Your previously enabled 2FA will be turned off.

Windows

xcli disable-2fa-for-user

macOS/Linux

./xcli disable-2fa-for-user

2FA commands table

Command/Type

For a specific user

For everyone in the workspace

Enable 2FA

enable-2fa

enable-2fa-for-workspace

Disable 2FA

disable-2fa

disable-2fa-for-workspace

Stay in the loop

Catch the latest updates, exchange advice, explore practical use cases.

Get product updatesTelegram channelAsk other usersTelegram chatExplore use casesDiscord community