Skip to content
Deploy

RDP how-to

How to secure RDP on Windows Server: a hardening checklist

Remote Desktop security on a Windows server comes down to a handful of settings. This checklist gives each one that reduces the risk of password guessing, why it matters and exactly where to set it, from Microsoft's documentation.

RyzenRDP guide cover: how to secure RDP on Windows Server, a hardening checklist

Key takeaways

  • Remote Desktop open to every address is open to password guessing. Microsoft advises against it and prefers a VPN.
  • Three steps do the most: keep Network Level Authentication on, limit the Remote Desktop firewall rules to your own IP addresses, and set an account lockout policy that covers the account you sign in with (Microsoft's baseline: 10 attempts).
  • Then turn off SMBv1, keep Defender and the firewall on, audit failed sign-ins (Event ID 4625) and install updates: Windows Server does not install them by itself by default.
  • Moving port 3389 only cuts the noise. Before any change, make sure you have a way in that does not use Remote Desktop: your provider's server console, where your provider offers one, or on RyzenRDP a support ticket.
On this page
  1. Is RDP secure enough to leave open to the internet?
  2. The RDP hardening checklist at a glance
  3. Keep Network Level Authentication on
  4. Limit Remote Desktop to your IP addresses
  5. Set an account lockout policy (and the Administrator caveat)
  6. Use strong, unique passwords and a second sign-in step
  7. Disable SMBv1 and check Defender and the Windows firewall
  8. Log failed sign-ins and read them
  9. Keep Windows updated
  10. Does changing port 3389 help?
  11. Keep a way in that does not use Remote Desktop
  12. Check it free, or have it done at a fixed price

Is RDP secure enough to leave open to the internet?

Not on its own. The connection is encrypted, but encryption does not stop anyone from trying passwords: a server that answers Remote Desktop from every address gets automated sign-in attempts day and night. Microsoft's Remote Desktop guide says opening a PC to the internet "isn't recommended" and that a VPN is preferable.

If Remote Desktop has to stay reachable, secure RDP in layers: keep Network Level Authentication on, limit the port to your own IP addresses, lock accounts after repeated wrong passwords, audit failed sign-ins and keep Windows updated. Together they reduce the risk of brute-force sign-ins; none of them makes a server impossible to break into. The steps apply to Windows Server 2019, 2022 and 2025, on any Windows VPS or office server.

The RDP hardening checklist at a glance

Step Why it matters Where to set it
Network Level Authentication on The sign-in is checked before a session starts System Properties, Remote tab, or Group Policy
Remote Desktop limited to your IP addresses Other addresses never reach the sign-in Windows firewall Remote Desktop rules, and your provider's firewall
Account lockout policy Slows password guessing Local Security Policy, Account Lockout Policy
Strong passwords and a second sign-in step A leaked password alone is not enough Local users and groups; an MFA sign-in agent
SMBv1 off, port 445 closed to the internet An old file-sharing protocol that worms used Set-SmbServerConfiguration, Windows firewall and your provider's firewall
Defender and the Windows firewall on Firewall rules apply only while the firewall is on Get-MpComputerStatus, Get-NetFirewallProfile
Failed sign-ins audited Guessing shows up as Event ID 4625 auditpol, Security log
Windows updated The serious Remote Desktop flaws had patches Windows Update, or SConfig
A way in without Remote Desktop You can undo a mistake Your provider's server console where it offers one; on RyzenRDP, a support ticket

Run the commands below in PowerShell as Administrator. Keep your current session open and test each change from a new connection.

Keep Network Level Authentication on

Network Level Authentication (NLA) makes the client prove the user name and password before Windows builds a session. Microsoft's security team called it a partial mitigation for the BlueKeep flaw (CVE-2019-0708) in older Windows versions. Microsoft's policy reference says NLA is enforced by default on Windows Server 2012 and Windows 8. It names no later version, so check it:

(Get-CimInstance -Namespace root\cimv2\TerminalServices -ClassName Win32_TSGeneralSetting -Filter "TerminalName='RDP-tcp'").UserAuthenticationRequired

1 means NLA is required. If not, run SystemPropertiesRemote.exe and tick Allow connections only from computers running Remote Desktop with Network Level Authentication, or enable the Group Policy Require user authentication for remote connections by using Network Level Authentication under Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Security. In the same folder, Microsoft's policy text recommends setting Require use of specific security layer for remote (RDP) connections to SSL. Our Network Level Authentication guide covers the errors you may see afterwards.

Limit Remote Desktop to your IP addresses

This step does the most: if only your addresses can reach the port, nobody else gets to try a password. Windows keeps its Remote Desktop rules in the firewall group Remote Desktop (on an English-language Windows). List them and the addresses they allow, then limit them to yours:

Get-NetFirewallRule -DisplayGroup 'Remote Desktop' | Format-Table Name, Enabled, Profile
Get-NetFirewallRule -DisplayGroup 'Remote Desktop' | Get-NetFirewallAddressFilter | Format-Table InstanceID, RemoteAddress

Set-NetFirewallRule -DisplayGroup 'Remote Desktop' -RemoteAddress 198.51.100.7, 203.0.113.0/24

-RemoteAddress takes single addresses, subnets and ranges (Microsoft's Set-NetFirewallRule reference). Then:

  • Test from a new connection at an allowed address while your current session stays open.
  • Close the other doors. A rule of your own for a moved port, or any other allow rule for the same port, still lets every address in: limit it too.
  • Dynamic home address? Microsoft suggests allowing your internet provider's whole range. The other way is a VPN with a fixed address, and allowing only that address.
  • Your provider's firewall, if your host has one in its control panel, needs the same limit.

Set an account lockout policy (and the Administrator caveat)

A lockout policy locks an account for a while after repeated wrong passwords, which slows guessing to a crawl. Microsoft's Account lockout threshold page lists 0 (never locks) as the stand-alone server default, but KB5020282 says computers set up with the October 2022 or later updates get 10/10/10 at setup. Run net accounts to see the values on your server. Microsoft's security baseline suggests 10 attempts, and KB5020282 recommends 10/10/10. In Local Security Policy (secpol.msc), open Account Policies > Account Lockout Policy and set:

  1. Account lockout threshold: 10 invalid sign-in attempts.
  2. Account lockout duration: 10 minutes.
  3. Reset account lockout counter after: 10 minutes.

Run net accounts again to confirm the values in effect. No restart is needed.

The Administrator caveat. Microsoft's Account lockout threshold page says the built-in Administrator is excluded from this policy, so an administrator can always get in to fix a problem. If you sign in as the built-in Administrator, the lockout policy does not cover it unless Allow Administrator account lockout (same folder, added by the 11 October 2022 updates) is Enabled. KB5020282 (Windows Server 2019 and 2022) says that lockout applies to network sign-ins such as Remote Desktop, and console sign-ins still work. Enable it once Remote Desktop is limited to your own addresses, so a stranger cannot keep the account locked: anyone who knows an account name can lock it, Microsoft warns. Or sign in with a separate administrator account, which the policy already covers.

Use strong, unique passwords and a second sign-in step

  • A long, unique password for every account with remote access, kept in a password manager.
  • Know who can connect. By default, members of Administrators can use Remote Desktop, and other users need to be in Remote Desktop Users. Get-LocalGroupMember Administrators lists the first group. Remove accounts nobody uses.
  • Add a second step, so a stolen password alone does not get in. Microsoft's typical design for Remote Desktop Services puts an RD Gateway in front, with Network Policy Server and Microsoft Entra multifactor authentication; we do not set one up. On a single server, an MFA provider's Windows sign-in agent adds the prompt. Duo's, for example, can prompt only for Remote Desktop sign-ins, leaving the console as a way back in.

Disable SMBv1 and check Defender and the Windows firewall

SMBv1 is not installed by default on Windows Server 2019 and later, Microsoft says, but check it. If the first command shows True, the second turns it off without a restart:

Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol
Set-SmbServerConfiguration -EnableSMB1Protocol $false

Microsoft also advises blocking TCP port 445, used by file sharing, inbound from the internet; its Secure SMB traffic page says to do it at the hardware firewall. On a single server, block it in your provider's firewall, and list the Windows firewall's file-sharing rules that let connections in (on an English-language Windows):

Get-NetFirewallRule -DisplayGroup 'File and Printer Sharing' -Enabled True -Direction Inbound | Format-Table DisplayName, Profile

If the server shares no files or printers, pipe the same query, without Format-Table, to Disable-NetFirewallRule, or limit those rules with Set-NetFirewallRule -RemoteAddress as for Remote Desktop.

Microsoft Defender Antivirus is installed and enabled by default on Windows Server 2016 and later. Confirm it runs with current definitions; AMRunningMode reads Normal, Passive or EDR Block Mode while it is on:

Get-MpComputerStatus | Select-Object AMRunningMode, AMServiceEnabled, AntivirusEnabled, RealTimeProtectionEnabled, AntivirusSignatureLastUpdated

Microsoft says Defender does not switch to passive mode by itself on Windows Server. With another antivirus product, Microsoft says to turn Defender off or remove it unless the server is onboarded to Microsoft Defender for Endpoint.

The Windows firewall must be on, or no rule applies. Get-NetFirewallProfile | Format-Table Name, Enabled should show True for every profile. Before you turn a profile on, make sure the Remote Desktop rules are enabled.

Log failed sign-ins and read them

A failed sign-in is recorded as Event ID 4625, "An account failed to log on", in the Security log, if the Audit Logon policy records failures. Check it, then turn on success and failure auditing if either is missing:

auditpol /get /subcategory:"Logon"
auditpol /set /subcategory:"Logon" /success:enable /failure:enable

Read the latest failures:

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} -MaxEvents 20 | Format-List TimeCreated, Message

Each event names the account and the logon type, and usually the Source Network Address. Many failures for Administrator from addresses you do not know mean someone is guessing passwords. If the address shows a hyphen, our Event ID 4625 guide shows where to find it, and it explains each field.

Keep Windows updated

BlueKeep (CVE-2019-0708), the best-known Remote Desktop flaw, had a Microsoft fix on the day it was announced, 14 May 2019. It affected Windows 7, Windows Server 2008 and 2008 R2 and older, not the versions this guide covers; the lesson is that serious Remote Desktop vulnerabilities get patches, and patches only help once installed. Microsoft notes that by default Windows Update does not install updates automatically on Windows Server 2016 and later. Use Settings > Windows Update, or run SConfig in PowerShell and choose 6, Install updates. Our guide to installing Windows updates from PowerShell does it from the command line.

Still on Windows Server 2016? Microsoft lists the end of its extended support as 12 January 2027; after that, security updates come only through Microsoft's paid Extended Security Updates. See Windows Server 2016 end of support. On a RyzenRDP server, Care installs Windows updates in a monthly window you pick, for $29 a month.

Does changing port 3389 help?

It cuts the noise, not the risk. Most automated scanners try the default port, so a moved port logs far fewer attempts, but a port scan still finds it and the password guessing that reaches it works the same way. Change it only after the steps above, with the new rule limited to your IP addresses; our RDP port 3389 guide gives the safe order, firewall rule first.

Keep a way in that does not use Remote Desktop

A firewall rule with a typo, a lockout, or a two-step agent that cannot reach its service can shut you out of Remote Desktop. Before you change anything:

  • Find your provider's server console, the view of the server's screen in its control panel, where your provider offers one, and sign in there once. It does not go through the Remote Desktop port.
  • Keep your current session open until a new connection works, and note each change so you can undo it.
  • Keep copies of your important data elsewhere, off the server.

On a RyzenRDP server, the RyzenRDP console is your account (servers, invoices and tickets), not a view of the server's screen. Locked out after a change of your own? Your way back in is a ticket of the type "Technical support" there; the console keeps working while Remote Desktop is down. If a port or firewall change locked you out, putting Remote Desktop back is an RDP Rescue fix at $39, invoiced only once you can sign in again. Once you agree on the ticket, we can reach the server's screen without Remote Desktop. Other work, such as removing a two-step sign-in agent, is admin time at $29 per 30 minutes, prepaid. With the lockout settings above, an account lockout ends by itself after 10 minutes.

Check it free, or have it done at a fixed price

Every step above can be done by hand. If you would rather not:

  • RDP Security Check (Free): a PowerShell script you run on your own server. It reads your Remote Desktop settings, changes nothing and lists what is missing. We never scan your server from outside.
  • Hardened Start ($9 one-time): an option, not ticked for you, when you deploy a RyzenRDP Windows server: NLA, a lockout policy, TLS for Remote Desktop, SMBv1 off, Defender and firewall checks and sign-in auditing, with a short report. Remote Desktop stays on port 3389, open to every address.
  • RDP Lockdown Standard ($79 one-off): the Remote Desktop settings of this checklist (Network Level Authentication, TLS, account lockout, SMBv1 off, Defender, firewall and audit checks) on one server running Windows Server 2019, 2022 or 2025, at RyzenRDP or another provider, with a review of local administrators and, if you want it, the limit to your IP addresses, plus a before-and-after report of every setting. Windows updates are not part of it.
  • RDP Lockdown Plus ($149 one-off): Standard plus two-step sign-in on an MFA account of your own, set up in a session with you. No RD Gateway.

RDP Lockdown reduces the risk of brute-force sign-ins; it cannot make any server impossible to break into. For Windows Server 2016, see the server move. On a RyzenRDP Windows VPS, the Windows Server license is not included in the plan price: Windows Server is installed for you but not activated, and you license and activate it yourself.

FAQ

Is RDP safe to use over the internet?

Not with default settings. The connection is encrypted, but a server that answers Remote Desktop from every address gets password guesses all day, and Microsoft prefers a VPN. Keep Network Level Authentication on, allow only your IP addresses, set an account lockout policy and keep Windows updated to reduce the risk of brute-force sign-ins.

Does changing the RDP port make my server safe?

No. A port other than 3389 gets fewer automated attempts, so your logs are quieter, but a port scan finds it and password guessing works the same there. Limiting Remote Desktop to your IP addresses and an account lockout policy do far more.

What account lockout threshold should I use?

Microsoft's baseline suggests 10 failed attempts, and KB5020282 recommends 10/10/10: lock after 10 failures, for 10 minutes, with the counter reset after 10 minutes. Microsoft's Account lockout threshold page lists 0 (never locks) as the stand-alone server default, but KB5020282 says computers set up with the October 2022 or later updates get 10/10/10 at setup; run net accounts to see your values. The policy does not cover the built-in Administrator unless "Allow Administrator account lockout" is Enabled. Enable it once Remote Desktop is limited to your own addresses, or sign in with a separate administrator account, which the policy covers.

Should I use a VPN instead of opening Remote Desktop?

Microsoft prefers a VPN to opening Remote Desktop to the internet; then allow Remote Desktop only from the VPN's addresses. If you connect from fixed IP addresses, limiting the Remote Desktop firewall rules to them gets most of the same benefit.

How do I harden RDP without locking myself out?

First confirm you can sign in through your provider's server console, where your provider offers one; it does not use Remote Desktop. On a RyzenRDP server, the RyzenRDP console is your account, not a view of the server's screen, so your way back in is a support ticket. Keep your current session open, test each change from a new connection, and note what you changed so you can undo it.

How do I check my current RDP security settings?

Run the free RDP Security Check, a PowerShell script that reads your Remote Desktop settings, changes nothing and lists what is missing. By hand, the read-only commands in this guide show each setting, from Win32_TSGeneralSetting for Network Level Authentication to auditpol for sign-in auditing.

Will you harden a Windows server at another provider?

Yes, if it runs Windows Server 2019, 2022 or 2025, you can show us it is yours with a one-time code, and you can open its console at that provider. RDP Lockdown Standard ($79 one-off) applies the Remote Desktop settings in this checklist: Network Level Authentication, TLS, an account lockout policy, SMBv1 off, Defender, firewall and audit checks, a review of local administrators and, if you want it, the limit to your IP addresses. You get a before-and-after report. It does not install Windows updates. Plus ($149) adds two-step sign-in. See RDP Lockdown.

Sources

  1. Microsoft Learn: Enable Remote Desktop on your PC (Network Level Authentication, strong unique passwords)
  2. Microsoft Learn: Remote Desktop: allow access to your PC from outside your network (opening to the internet not recommended, VPN preferable, source address limits)
  3. Microsoft Learn: ADMX_TerminalServer Policy CSP and RemoteDesktopServices Policy CSP (NLA and security layer policies)
  4. Microsoft Learn: Win32_TSGeneralSetting class (UserAuthenticationRequired)
  5. Microsoft Learn: Set-NetFirewallRule (DisplayGroup, RemoteAddress formats)
  6. Microsoft Learn: Account lockout threshold (baseline 10, default 0, built-in Administrator, denial of service)
  7. Microsoft Support: KB5020282, Account lockout available for local administrators (Allow Administrator account lockout, 10/10/10)
  8. Microsoft Learn: Plan multifactor authentication for Remote Desktop Services
  9. Cisco Duo: Duo Authentication for Windows Logon & RDP (prompt for RDP sign-ins only)
  10. Microsoft Learn: Detect, enable, and disable SMBv1, SMBv2, and SMBv3 in Windows, Secure SMB traffic in Windows Server (block TCP 445 inbound from the internet), Get-NetFirewallRule and Disable-NetFirewallRule
  11. Microsoft Learn: Configure Microsoft Defender Antivirus on Windows Server, Microsoft Defender Antivirus compatibility with other security products and Get-MpComputerStatus (on by default; no automatic passive mode on Windows Server; AMRunningMode; Windows Update not automatic by default)
  12. Microsoft Learn: Audit Logon, 4625(F) An account failed to log on and auditpol set
  13. Microsoft Learn: Server Configuration tool (SConfig) (Install updates)
  14. Microsoft Security Response Center: Prevent a worm by updating Remote Desktop Services (CVE-2019-0708), 14 May 2019
  15. Microsoft Learn: Windows Server 2016 lifecycle and Change the listening port for Remote Desktop

All read on 14 November 2026.

Run Windows Server on AMD Ryzen or AMD EPYC

Full Administrator access, Remote Desktop ready, set up instantly. Plans from $14.99/mo.