Secure Remote Desktop on Windows Server

Stop password-guessing on Remote Desktop with strong passwords, Network Level Authentication, a lockout policy and firewall rules limited to your IP.

  • Intermediate
  • Windows VPS · Admin RDP
  • 3 min read

By RunRacks Team · Published

Any server with Remote Desktop open to the internet sees automated password-guessing within hours. The good news: a handful of built-in Windows settings stop almost all of it. Work through them in this order.

1. Use long, unique passwords

Every account that can log in over RDP needs a long password (14+ characters) that is not used anywhere else. Rename or disable accounts nobody uses. See Change your Windows server password safely.

2. Keep Network Level Authentication on

Network Level Authentication (NLA) makes the client prove who it is before Windows opens a full login session. It is on by default on current Windows versions; check it:

  1. Press Windows + R, type SystemPropertiesRemote and press Enter.
  2. Under Remote Desktop, make sure Allow connections only from computers running Remote Desktop with Network Level Authentication is ticked.

Or check in PowerShell (1 means on):

PowerShell
(Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp").UserAuthentication

3. Set an account lockout policy

A lockout policy pauses an account after too many wrong passwords, which makes guessing very slow. This example locks an account for 15 minutes after 10 failures:

PowerShell
net accounts /lockoutthreshold:10 /lockoutwindow:15 /lockoutduration:15
net accounts

4. Allow RDP only from your IP addresses

This is the single most effective step. Find your public IP address (search "what is my IP" in a browser on your own computer), then limit the built-in Remote Desktop rules to it:

PowerShell
Set-NetFirewallRule -DisplayGroup "Remote Desktop" -RemoteAddress 198.51.100.10
Get-NetFirewallRule -DisplayGroup "Remote Desktop" | Get-NetFirewallAddressFilter

List several addresses or ranges separated by commas, for example 198.51.100.10,192.0.2.0/24. To open it to everyone again, use -RemoteAddress Any.

5. Check who is trying to log in

Failed logins are recorded in the Security log as event 4625. This shows the most recent ones:

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

6. Optional extras

Troubleshooting

  • Locked out after restricting the IP: open the browser console from the control panel (how) and run the -RemoteAddress command with your new IP.
  • "The user account is locked": wait for the lockout duration, then sign in with the correct password.

Next steps

Was this guide helpful?

Still stuck?

Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Security

Check the Windows Firewall rule for RDP port 12230

Find and verify the inbound TCP 12230 rule that lets Remote Desktop reach your RunRacks server, recreate it if it was deleted and scope it without locking yourself out.

  • Intermediate
  • Windows VPS · Admin RDP
  • 5 min read

Security

iptables basics: list, allow, drop and save rules

Learn how iptables chains and rule order work, then build a small ruleset that allows SSH and web traffic, drops everything else and can be edited by line number.

  • Intermediate
  • Linux VPS
  • 6 min read