Save 10%Pay yearly on any plan. 6% half-yearly, 3% quarterly. Help centreWhatsAppTelegram TeamsOpen a ticket

How to Secure Remote Desktop (RDP) on Your Windows Server

Nine settings that protect Remote Desktop on a Windows server: strong logins, lockout, Network Level Authentication, limited users, firewall scope and more.

4 min readBy Swati

Reviewed by the AmazingRDP technical team

Securing Remote Desktop

These settings need administrator rights. A Windows VPS gives you full admin access. See Windows VPS from $8.99

The Remote Desktop session itself is encrypted; nobody on the network can read what you type. The weak point is the login. A server with Remote Desktop open to the internet is found by scanners within hours, and from then on bots try passwords against it all day. Nearly every break-in through RDP is a guessed or stolen password, or an unpatched server. The settings below close those routes.

They are for a server on which you are the administrator. On a shared remote desktop the provider looks after them; your part there is setting 1.

1. A long, unique password

Change the password you were sent on the first day. Use at least 14 characters, not used anywhere else, kept in a password manager. This one step defeats almost all automated attacks.

2. Do not work as "Administrator"

Bots try the user name Administrator first, because it exists everywhere.

  1. Create a new account with a name of your own and make it a member of Administrators.
  2. Sign in with it and check that it works.
  3. Disable the built-in account: net user Administrator /active:no.

Do the steps in this order, or you lock yourself out.

3. Account lockout

Make Windows block an account for a while after several wrong passwords.

  1. Run secpol.msc.
  2. Go to Account Policies, Account Lockout Policy.
  3. Set Account lockout threshold to 5 to 10 attempts, and the two time settings to 15 minutes or more.

Recent Windows versions switch a lockout on by default; check that it is there. Be aware of the side effect: an attacker hammering your user name can lock you out for those minutes, which is one more reason for a user name they do not know, and for setting 6.

4. Network Level Authentication

With NLA, the login is checked before the server draws a desktop. Without it, anyone reaches the Windows login screen and the server spends resources on each visitor.

Open System Properties (sysdm.cpl), the Remote tab, and tick Allow connections only from computers running Remote Desktop with Network Level Authentication. It is on by default; make sure nobody switched it off to "fix" a connection problem.

5. Limit who may log in

By default every administrator may connect. Give Remote Desktop access to named accounts only:

  1. On the same Remote tab, click Select Users and add the accounts that need it. They become members of the group Remote Desktop Users.
  2. For a stricter setup, open secpol.msc, Local Policies, User Rights Assignment, Allow log on through Remote Desktop Services, and take Administrators out, leaving only your group. Check first that your own account is in that group.

6. Restrict the port to your addresses

If you connect from places with fixed IP addresses, this is the strongest setting of all: nobody else can even reach the login.

  1. Run wf.msc and open Inbound Rules.
  2. Open each rule named Remote Desktop - User Mode (TCP-In) and (UDP-In).
  3. On the Scope tab, under Remote IP address, choose These IP addresses and add yours.

If your address changes often, do not use this, or keep the provider's console in reach for the day it does.

7. Keep Windows updated

Serious flaws in Remote Desktop have been found and fixed over the years. A server that installs updates is protected against the known ones; a server that does not is a target. Install updates monthly and restart.

8. End idle sessions

A session left signed in on a forgotten PC is an open door. In gpedit.msc, under Computer Configuration, Administrative Templates, Windows Components, Remote Desktop Services, Remote Desktop Session Host, Session Time Limits, set a limit for idle and for disconnected sessions. Choose the disconnected limit with care if programs must keep running after you disconnect.

9. Watch the log

Failed logins are recorded in Event Viewer, Windows Logs, Security, as event 4625; successful ones as 4624. A glance now and then shows whether someone is trying, and a successful login at an hour when you were asleep is a reason to act at once.

What about changing the port?

Moving Remote Desktop from 3389 to another port cuts most of the automated noise and is worth doing for that. It is not protection by itself, since a full port scan finds it. Treat it as an addition to the settings above: see connecting to RDP on a different port.

For more than a few users

  • A VPN or a Remote Desktop Gateway in front, so that port 3389 is not exposed at all.
  • Two-step login through the gateway or a third-party tool.

If you think someone got in

  1. Change all passwords from another, clean device.
  2. Look at the user list for accounts you did not create, and at scheduled tasks and startup programs.
  3. If in doubt, copy your data off and reinstall the server from the control panel. A system that was under someone else's control cannot be trusted again.

Related: opening ports on Windows Server, why the firewall stays on, and fixing the Remote Desktop internal error, which too many failed logins can cause. A Windows VPS gives you the administrator rights for all of this.

Questions

Is RDP secure?

The session is encrypted. The risk is the login: weak passwords and unpatched servers are how attackers get in.

How do I protect RDP from brute-force attacks?

Use a long unique password and a non-standard user name, set an account lockout, keep Network Level Authentication on, and restrict the port to your own IP addresses where you can.

What is Network Level Authentication?

A setting that checks the login before the server shows a desktop, so strangers cannot reach the Windows login screen.

Does changing the RDP port make it secure?

It reduces automated attempts but does not stop a determined scan. Use it together with the other settings.