Video failed to load

TOTP Two-Factor Authentication for Windows Remote Logins

846 words
4 minutes
TOTP Two-Factor Authentication for Windows Remote Logins
TOTP Two-Factor Authentication for Windows Remote Logins

Translation Notice

This article was originally written in Chinese and translated into English with the assistance of AI. The translation has been reviewed and edited for clarity, accuracy, and readability. Please refer to the original source where necessary, especially for technical terms, commands, configuration details, and proper nouns.

By default, Windows Remote Desktop (RDP) relies only on a username and password. If the password is exposed, the server may face brute-force and credential-stuffing attacks.

This article explains how to use multiOTP Credential Provider to add TOTP two-factor authentication to Windows login. In addition to credentials, remote desktop users must enter a one-time code, significantly improving server remote-login security.

Features:

  • ✅ Windows Server / Windows 10 / Windows 11
  • ✅ Two-factor verification for RDP
  • ✅ Mainstream authenticators such as Google Authenticator and Tencent Authenticator
  • ✅ Fully offline operation; no Internet connection required
  • ✅ Free and open source
multiOTP
/
multiOTPCredentialProvider
multiOTP Credential Provider is a V2 Credential Provider for Windows 7/8/8.1/10/11/2012(R2)/2016/2019/2022/2025 with options like RDP only, UPN name support and push token support with multiOTP token app
Apache-2.0
PHP

Download#

Official project:

https://github.com/multiOTP/multiOTPCredentialProvider/releases/tag/5.10.2.2

China mirror:

http://oss-huating-1.bytesycn.cn/files/zip/multiOTPCredentialProvider-5.10.2.2.zip


What Is TOTP?#

TOTP (Time-based One-Time Password) is a time-based one-time password algorithm.

It combines a shared secret with the current time, typically changing every 30 seconds, to generate a six-digit one-time code.

Even if an attacker obtains the Windows password, they cannot complete the remote login without the code on the user’s phone.

Compared with password-only login, this helps defend against:

  • Password exposure
  • Brute-force attacks
  • Credential stuffing
  • Weak-password risks

The following authenticators are recommended:

  1. Tencent Authenticator (recommended)
  2. Google Authenticator
  3. Microsoft Authenticator
  4. 2FAS Authenticator

The first two options are recommended.

Note

Google Authenticator may be unavailable for download in some regions.

Microsoft Authenticator does not make key export and migration especially convenient; changing phones may require reconfiguration.


⚠️ Read Before Installing#

After installation and a system restart, two-factor verification will be enabled for RDP immediately.

Therefore, make sure the server has at least one local access method:

  • VMware Console
  • Hyper-V Console
  • VNC
  • iDRAC / iLO / IPMI
  • A physical monitor

Do not install this directly on a server whose only access method is RDP.

If token configuration is incomplete, you will be unable to log in through RDP.


Installation Steps#

1. Install Visual C++ Runtime#

Install the VC++ runtime first.

Choose the version that matches your system.

Choose a version
Choose a version

Install VC++
Install VC++


2. Install multiOTP Credential Provider#

Run the installer.

Open multiOTP.msi
Open multiOTP.msi

Click Next.

Next
Next

Accept the license agreement.

Accept the license agreement
Accept the license agreement

2.1. Login Title#

Here you can change the name displayed on the Windows login screen.

Also make sure to select:

No remote server, local multiOTP only

This selects local mode, which does not depend on remote RADIUS/LDAP or other authentication servers.

Select the option indicating no remote server
Select the option indicating no remote server

Continue the installation.

Continue installation
Continue installation

2.2. Choose the Verification Scope#

Recommended option:

Only Remote

This means:

  • Local login does not require a code
  • RDP login requires a code

Servers and jump hosts are generally administered through RDP, so enabling two-factor authentication only for remote logins is recommended.

This preserves a recovery path through VNC, IPMI, or physical login if the phone is lost or token configuration fails.

Select remote-only verification
Select remote-only verification

Click Install.

Start installation
Start installation

Installation is complete.

Installation complete
Installation complete


3. Restart the Server#

Restart the system after installation.

After the restart, RDP login will go directly to code verification.

Use one of the following for subsequent configuration:

  • VMware Console
  • VNC
  • Hyper-V Console
  • IPMI
  • Local login

to continue.

Even with the correct password, a TOTP code will be required.

TOTP required for remote login
TOTP required for remote login


Configure TOTP#

Log in to the server through VNC or a physical console.

Direct connection through VNC
Direct connection through VNC

Open CMD as an administrator.

Change to the installation directory:

Terminal window
cd "C:\Program Files\multiOTP"

Open the program path
Open the program path


1. Create a Token#

Run:

Terminal window
multiotp.exe -fastcreatenopin Administrator

This command generates a new TOTP secret for the Administrator user.

Create a token
Create a token


2. Generate a QR Code#

Run:

Terminal window
multiotp.exe -qrcode Administrator Administrator.png

This generates a QR-code image in the current directory.

Generate a QR code
Generate a QR code


3. Scan the QR Code with Your Phone#

Open any TOTP app.

Scan the QR code to complete the binding.

Scan the QR code with a phone
Scan the QR code with a phone


4. Verify the Code#

Enter:

Terminal window
multiotp.exe Administrator 123456

Where:

123456

replace it with the code shown on your phone.

If the command produces no output, verification succeeded.

Verify TOTP
Verify TOTP


Test RDP Login#

You can now log in to the server through RDP normally.

First enter:

  • Username
  • Password

After authentication succeeds, the following prompt appears:

One-Time Password

Enter the one-time code shown on your phone.

Enter the TOTP code
Enter the TOTP code

After verification, Windows opens.

Log in to the server
Log in to the server


Frequently Asked Questions#

Does RDP Keep Reporting an Invalid Code?#

Check the following:

  • Whether the Windows time is correct
  • Whether automatic time synchronization is enabled on the phone
  • Whether the newest QR code was scanned
  • Whether the token was regenerated

Because TOTP is time-based, a clock difference of more than a few dozen seconds can cause verification to fail.


Does Local Login Require a Code?#

If Only Remote was selected during installation:

  • Local login: no code required
  • RDP login: code required

This mode is recommended for servers.


Are Multiple Users Supported?#

Yes.

Each Windows user can have an independent TOTP secret.

For example:

Terminal window
multiotp.exe -fastcreatenopin user1
multiotp.exe -fastcreatenopin user2
multiotp.exe -fastcreatenopin user3

Each user can bind their phone using their own QR code.


How Do I Restore Access?#

If the phone is lost or the code cannot be used, access the system through:

  • VMware Console
  • VNC
  • IPMI
  • iDRAC
  • iLO
  • Local login

Then regenerate the token or uninstall multiOTP.

Always keep at least one local access method available.


Summary#

At this point, we have successfully added TOTP two-factor authentication to Windows Remote Desktop (RDP).

Compared with password-only login, an attacker who obtains the Windows password still cannot authenticate without the code on the phone, significantly improving remote-login security.

For servers with public RDP exposure, operations jump hosts, or important production systems, also use:

  • A strong password policy
  • Restricted RDP source IPs
  • Changing the default 3389 port when appropriate
  • Windows Firewall
  • TOTP two-factor authentication
  • Regular login-log reviews

Layered protections are more effective at reducing the risk of brute-force attacks, password exposure, and unauthorized access.

Support & Share

If this article helped you, please share or support!

Sponsor
TOTP Two-Factor Authentication for Windows Remote Logins
https://blog.bytesycn.cn/posts/2ce28f72-c88f-4836-a0c0-adc9c4b16b26/
Author
Ryan Zhang
Published at
2026-08-21
Related PostsSmart
1
nwipe Tutorial: Secure Data Destruction with an Open-Source Tool
Tutorialnwipe is a lightweight yet powerful open-source data-erasure tool supporting multiple international standards. This guide covers installation, usage, and practical scenarios for securely destroying sensitive data.
2
Information Leaks — A Responsibility Software Vendors Must Own
Personal ViewsBehind the frequent data leaks lies society’s increasingly blurred understanding of privacy. Developer negligence, institutional apathy, and user compromise have woven a exposed online world. Security is no longer merely a technical issue.
3
Data Destruction: An Overview of Technologies and Standards
KnowledgeAn analysis of data-destruction technologies and standards, including domestic and global overwrite standards such as the three- and seven-pass methods in GA/T 1143 and DoD 5220.22-M; logical erasure of storage media; and physical shredding as the ultimate safeguard. The article compares mainstream standards, their principles, strengths, weaknesses, and use cases, and introduces common destruction tools such as AOMEI Assistant and nwipe.
4
Installing an FTP Service on XC Operating Systems
TutorialA practical guide to deploying an FTP server in an XC environment, covering the complete process of installing, configuring, and hardening vsftpd.
5
🐾 OpenClaw Installation Guide and Personal Thoughts — 2026.03
TutorialA detailed guide to OpenClaw 2026.03, covering one-click Linux deployment, Feishu bot long connections, and local-model integration. It explores the security philosophy of private AI, emphasizing least privilege and data boundaries so idle hardware can become a powerful private assistant without sacrificing privacy.
Random PostsRandom

Comments

Profile Image of the Author
Ryan Zhang
Keep building, keep thinking, keep creating.
Announcement
Welcome to my blog!
Categories
Tags
Latest Moments
Site Statistics
Posts
30
Categories
7
Tags
42
Total Words
117,260
Running Days
0 days
Last Activity
0 days ago
Table of Contents