How to Secure Remote Desktop Access on a Dedicated Server
In this article
Securing remote desktop access on a dedicated server means closing the easy ways in and forcing every connection through authentication and encryption you control. The shortest working set: change the RDP port away from 3389, require Network Level Authentication, put a firewall rule in front that only allows your own IP addresses, enable account lockout, and never expose RDP directly to the open internet without a VPN or an RDP gateway in front of it. If you can, skip the public port entirely and connect through a VPN or an SSH tunnel. The steps below assume a Windows Server with Remote Desktop enabled; menu labels can differ slightly by Windows Server version and by your hosting provider's control panel.
What You'll Need
- Administrator access to the server, either through the provider's console (KVM/IPMI/VNC) or an existing remote session. Keep the console open while you change remote access settings, because a mistake can lock you out.
- The public IP address you will connect from, so you can restrict the firewall to it. If your home IP is dynamic, plan for updating the rule or use a VPN instead.
- Access to your hosting provider's firewall or security group panel, if they offer one in front of the server.
- A VPN option if you want to avoid exposing RDP at all: either a VPN server on the dedicated machine or a provider-supplied private network.
- A second administrator account you can test with, so you do not lock out your only login.
Step-by-Step
- Confirm you can reach the server console. Log in to your hosting provider's control panel and open the out-of-band console. Keep that tab open for the rest of this process. If you make a firewall mistake, this is your way back in.
- Update Windows first. Open Settings and run Windows Update until no updates remain. Many RDP vulnerabilities are patched at the operating system level, so an unpatched server is the biggest risk regardless of what else you do.
- Require Network Level Authentication. Open System Properties (the classic System control panel item), go to the Remote tab, and make sure the option requiring computers to use Network Level Authentication is enabled. NLA forces authentication before a session is created and blocks a large class of pre-login attacks.
- Restrict who can log in remotely. In the same Remote tab, use Select Users to add only the specific accounts that need RDP. Remove any broad group such as a general Users group if it is present. Every extra account is another password to guess.
- Rename or disable the default Administrator account. Open Local Users and Groups (or Computer Management) and either rename the built-in Administrator account or disable it, then use a named admin account instead. Attackers try Administrator first on every server.
- Set strong passwords and account lockout. Open Local Security Policy and configure an account lockout threshold (for example a small number of failed attempts), a lockout duration, and a reset counter. Then enforce a password policy with a reasonable minimum length. This turns brute-force guessing into a dead end.
- Move RDP off port 3389. Open the registry editor and navigate to the Remote Desktop Terminal Server port value under the Terminal Server section of the Windows registry, change it to a high port number, and restart the Remote Desktop Services service. Then update your firewall rule to match. This does not stop a determined scanner, but it removes the constant background noise of automated attempts.
- Lock the firewall to your IP. In Windows Defender Firewall with Advanced Security, edit the inbound rule for Remote Desktop and set the Remote IP address scope to only your own address or a small range. Do the same in your hosting provider's firewall panel if one exists, since that layer sits in front of the operating system entirely.
- Better: put a VPN in front and close the public port. Set up a VPN server on the dedicated machine or use a private network feature from your provider, connect to the VPN first, then reach RDP over the private address. With this in place, remove the public RDP firewall rule entirely. This is the strongest practical option for a dedicated server.
- Test before you walk away. Open a second RDP session from the allowed IP and confirm it works. Then try from a different network or with the VPN disconnected and confirm it fails. Only after both tests should you close the console tab.
- Turn on logging and review it. Enable audit logging for logon events and check the Security log periodically for repeated failed logons from unfamiliar addresses. A sudden burst of failures is your early warning that someone is probing the server.
Common Mistakes
- Changing the RDP port or firewall rules without the provider console open, then getting locked out of your own server.
- Leaving the built-in Administrator account enabled with its default name, which is the first account every automated attack tries.
- Restricting the firewall to an IP address that later changes, and then wondering why remote access stopped working.
- Assuming a changed port is security. It only reduces noise; it does not replace authentication, NLA, or a VPN.
- Giving RDP access to shared or group accounts that several people use, which makes auditing impossible and weakens lockout policies.
- Forgetting the provider-level firewall, which can leave the port open even after you tightened Windows Firewall.
Tips
- Keep the provider console credentials somewhere you can reach without the server, such as a password manager on your phone.
- Use a VPN with certificate-based authentication if you can. It removes password guessing from the equation entirely.
- Review the list of accounts allowed to use RDP every few months and remove anyone who no longer needs it.
- Keep a written note of the custom RDP port and firewall scope, because future you will not remember.
- Apply Windows updates on a schedule rather than only when something breaks.
Troubleshooting
If you cannot connect after making changes, work backwards through what you altered. First check whether the Remote Desktop Services service is running, then whether the firewall rule still matches your current public IP, then whether the port change took effect. If you are locked out entirely, use the provider console to log in locally, undo the last change, and test again. If connections fail only from some networks, the problem is usually the IP scope on the firewall rule rather than the server itself. If you see repeated failed logon attempts in the Security log, treat it as an active attack: tighten the firewall scope, confirm lockout is enabled, and consider moving to VPN-only access. If NLA causes connection errors from an older client, update the client rather than disabling NLA.
Frequently Asked Questions
Is changing the RDP port enough to secure a server?
No. It reduces automated scanning but does not stop targeted attempts. Pair it with NLA, restricted accounts, lockout policies, and ideally a VPN.
Should I expose RDP directly to the internet at all?
It is best avoided. A VPN or an RDP gateway in front of the server removes the public attack surface almost entirely.
What happens if I lock myself out?
Use your hosting provider's out-of-band console to log in locally and reverse the change. This is why you keep it open during setup.
Does Network Level Authentication break older clients?
It can block very old clients that do not support it. Update the client instead of turning NLA off.
How often should I review RDP access?
A few times a year is reasonable, and always after staff changes. Remove accounts that no longer need access.
Can I use both a VPN and a restricted firewall rule?
Yes, and it is a good combination. The firewall rule can be limited to the VPN's private address range.