Since 2016 · 50,000+ customers · ★ 5.0 on Google Live chatWhatsAppTelegramOpen a ticket
Get started
Windows Server

How to Set Up Two-Factor Authentication (2FA) on Windows Server

Set up two-factor authentication on Windows Server guide by 99RDP

Windows Server has no built-in two-factor authentication for Remote Desktop or console logons. A password alone is the only thing standing between an attacker and your server, which is why exposed RDP servers are a favourite target. You add 2FA with a credential provider, a small component that adds a second step to the Windows logon screen. This guide compares the main options and walks through setting up Duo, the most common choice, on Windows Server 2016, 2019, 2022 and 2025.

Quick answerFor one server or a small team, install Duo Authentication for Windows Logon and RDP. Duo's free plan covers up to 10 users, and after a password, users approve a push notification on their phone or enter a code. For a self-hosted option that works with Google or Microsoft Authenticator codes, use the open-source multiOTP credential provider.

Diagram of two-factor sign-in for RDP: password first, then an approval or code on your phone
How RDP 2FA works

Your options for Windows Server 2FA

OptionHow users approveCostBest for
Duo for Windows Logon and RDPPush, code or phone callFree up to 10 users; paid plans aboveMost small and medium setups
multiOTP credential providerTOTP code (Google/Microsoft Authenticator)Free, open sourceSelf-hosted, no cloud service
Microsoft Entra MFA via RD Gateway (NPS extension)Microsoft AuthenticatorNeeds Entra ID licencesOrganisations already on Microsoft 365 / Entra
Smart cards or security keysPhysical card or keyHardware + PKIHigh-security environments

"Google Authenticator for Windows Server" isn't a product: Google Authenticator is only the phone app that generates codes. You still need a credential provider such as multiOTP on the server to check them.

Before you start

  • Keep a way back in. Make sure you have console access (your provider's VNC/KVM console) before installing anything that changes the logon screen.
  • Take a snapshot or backup of the server if you can.
  • Know your users: 2FA applies to every interactive logon unless you limit it to RDP.

Set up Duo on Windows Server

Step 1: Create the application in Duo

  1. Sign up for Duo and open the Duo Admin Panel.
  2. Go to Applications → Protect an Application, search for Microsoft RDP, and click Protect.
  3. Note the Integration key, Secret key and API hostname.
Checklist before enabling 2FA for RDP: test on one server, keep a console way in, set offline behaviour
Before you turn it on

Step 2: Install Duo on the server

  1. Download the Duo Authentication for Windows Logon installer on the server and run it as Administrator.
  2. Enter the API hostname, integration key and secret key.
  3. Choose the options:
    • Bypass Duo authentication when offline (fail open): decide whether logons should work if the server can't reach Duo. Failing open keeps you from being locked out; failing closed is stricter.
    • Only prompt for Duo authentication when logging in via RDP: tick this if you want console logons (through your provider's console) to stay password-only as an emergency route.
  4. Finish the installation. No restart is usually needed.
Comparison of 2FA tools for Windows Server RDP: Duo, multiOTP and Microsoft Entra MFA
Which 2FA tool?

Step 3: Enrol users and test

Add users in the Duo Admin Panel (the usernames must match the Windows account names) and have them install Duo Mobile and activate it. Then open a new RDP connection, keeping your current session open: after the password, the Duo prompt should appear. Approve the push to log in.

Set up multiOTP (self-hosted TOTP)

multiOTP is a free, open-source 2FA server with a Windows credential provider that asks for a time-based code from any authenticator app.

  1. Download the multiOTP Credential Provider from the project's official GitHub releases page and install it on the server.
  2. In the setup wizard, choose whether it applies to RDP only, local logons only, or both.
  3. Create users and generate their QR codes with the multiOTP command-line tool, then scan each QR code in Google Authenticator or Microsoft Authenticator.
  4. Test in a new RDP session: after the password, Windows asks for the one-time code.

multiOTP takes more setup than Duo but doesn't depend on any cloud service.

Harden RDP as well

2FA is one layer. Also:

  • Keep Network Level Authentication enabled.
  • Restrict RDP to known IP addresses in the firewall, or put it behind a VPN or RD Gateway.
  • Set an account lockout policy and rename or disable unused accounts.
  • Keep Windows updated.

Frequently asked questions

Does Windows Server have built-in 2FA for RDP?

No. You need a credential provider such as Duo or multiOTP, or Microsoft Entra MFA through an RD Gateway.

Can I use Google Authenticator for Windows Server login?

Yes, with a credential provider that accepts TOTP codes, such as multiOTP. Google Authenticator just generates the codes on your phone.

Is Duo free for Windows Server?

Duo's free plan supports up to 10 users and includes the Windows Logon and RDP integration. Larger teams need a paid plan.

What if I lose my phone and get locked out?

Use your provider's console if you set Duo to prompt only for RDP, or use a bypass code from the Duo Admin Panel. Plan this before enabling 2FA.

Minakshi, Server Administrator L1 at 99RDP
Written byMinakshiServer Administrator L1, 99RDP. Part of the team that runs our servers and answers support.
Keep reading

More Windows Server guides

All Windows Server guides

Need a server for this?

✓ Setup in minutes✓ Full admin access✓ 7-day refund on new services