01
An administrator account in your own name
Start by replacing the delivery password with a long, unique one, stored in a password manager: in the session, press Ctrl+Alt+End, then Change a password. Connecting itself is covered in connecting to a Windows VPS over Remote Desktop.
Bots that target Remote Desktop try the names "Administrator" and "Administrateur" first. Create your own administrator account, in PowerShell run as administrator:
$mdp = Read-Host -AsSecureString "Mot de passe du nouveau compte"
New-LocalUser -Name "jdupont" -Password $mdp -FullName "Jean Dupont" -PasswordNeverExpires
Add-LocalGroupMember -SID "S-1-5-32-544" -Member "jdupont"
-SID "S-1-5-32-544": the fixed identifier of the Administrators group. It avoids depending on the Windows language, where the group is called "Administrators" or "Administrateurs". Members of this group are allowed to sign in over Remote Desktop.
-PasswordNeverExpires: without this option, the password policy may require a change after a while. A long, unique password does not need changing as long as it has not leaked.
Sign out, then sign in with the new account. Only once that works, disable the original administrator account, recognisable by its identifier ending in -500:
Get-LocalUser | Where-Object { $_.SID -like "S-1-5-*-500" } | Disable-LocalUser
02
Updates and Microsoft Defender
Windows Update. According to Microsoft, Windows Server does not download or install updates automatically by default. A VPS exposed to the Internet still needs its security fixes every month. Choose the mode with SConfig, option 5, and the time of restarts: the guide Windows Server updates details the options.
Microsoft Defender Antivirus is installed and enabled by default on Windows Server since version 2016. Check that it is running and that its definitions are recent:
Get-MpComputerStatus | Select-Object AntivirusEnabled, RealTimeProtectionEnabled, AntivirusSignatureLastUpdated
Update-MpSignature
Start-MpScan -ScanType QuickScan
- Definitions arrive through Windows Update. Even in "download only" mode, Microsoft states that Defender installs its definition updates on its own.
- Another antivirus: if one is installed, Defender usually switches to passive mode. Do not add a second one without a specific reason.
03
The firewall and Remote Desktop access
Windows Defender Firewall must stay on for all three profiles. Check it:
Get-NetFirewallProfile | Select-Object Name, Enabled
Restrict Remote Desktop to your addresses. This is the most effective setting: the Remote Desktop inbound rules then only accept the IP addresses you list. First open the customer area console in a tab, in case you lock yourself out, then replace the example addresses with yours:
Set-NetFirewallRule -Name RemoteDesktop-UserMode-In-TCP,RemoteDesktop-UserMode-In-UDP -RemoteAddress 203.0.113.10,198.51.100.0/24
You can give a single address, a network (198.51.100.0/24) or a range. If your home router changes address, the connection will be refused: from the console, the same command with -RemoteAddress Any reopens access to everyone. Changing the listening port also cuts down bot noise, without replacing this filtering: see changing the Remote Desktop port.
Network Level Authentication (NLA) requires you to authenticate before the session opens. Microsoft recommends it and advises keeping it on: it reduces the risk of unauthorised access. It is set in sysdm.cpl, Remote tab; the following command returns 1 when it is required:
(Get-CimInstance -Namespace root\cimv2\TerminalServices -ClassName Win32_TSGeneralSetting -Filter "TerminalName='RDP-Tcp'").UserAuthenticationRequired
04
Lock accounts after repeated failures
The lockout policy blocks an account after a number of failed sign-ins, which makes large-scale password guessing pointless. On a standalone server, the threshold is 0 by default, meaning accounts are never locked.
- Open
secpol.msc (Local Security Policy).
- Go to Security Settings › Account Policies, then Account Lockout Policy (translated on a French-language Windows).
- Set the threshold (Account lockout threshold), the lockout duration (Account lockout duration) and the counter reset delay (Reset account lockout counter after). Microsoft gives 10 attempts, 10 minutes and 10 minutes as a starting point.
Two limits to know:
- The built-in Administrator account is only subject to this lockout if the Allow Administrator account lockout policy is enabled, which depends on the installation. One more reason to work with your own account.
- An attacker who knows an account name can get it locked on purpose. An account name that is hard to guess and Remote Desktop kept to your own addresses avoid this trap. If it happens, the account unlocks on its own at the end of the chosen duration.
Failed sign-ins show in Event Viewer, Security log, event 4625; a locked account appears as event 4740.
05
Close what you do not use, back up the rest
Every service listening on the Internet is one more door. List what is waiting for connections, and the firewall rules that let them in:
Get-NetTCPConnection -State Listen | Sort-Object LocalPort | Select-Object LocalAddress, LocalPort, OwningProcess
Get-NetFirewallRule -Direction Inbound -Enabled True -Action Allow | Select-Object Name, DisplayName
- Do not publish Windows file sharing (SMB, port 445) on the Internet: to exchange files, see transferring files over Remote Desktop.
- A database, an admin panel or a monitoring tool does not need to be reachable by everyone: add
-RemoteAddress to its rule, as for Remote Desktop.
- A role or program installed for a test: uninstall it if it is no longer used, and download your software from its publisher's website.
Backups. Take a snapshot from the customer area before a major change. A snapshot stays on the same infrastructure as the VPS: it is not a backup. Also keep a copy of your data elsewhere, following the guide backing up a Windows VPS.
06
On CloudFive
CloudFive's Windows VPS, from €8.50 per month, comes with Windows Server installed, licence included, and Remote Desktop ready:
- an AMD Ryzen 9 9950X, with DDR5 memory and NVMe storage, and a dedicated IPv4 address;
- basic anti-DDoS protection included;
- the customer area console, which shows the VPS screen even when Remote Desktop is cut off, and snapshots;
- plan changes from the VPS page, with the difference charged pro rata.
The servers are in France, monthly with no commitment, with support in French 7 days a week. Securing Windows and your software remains your job: this is a server you administer. If you are still weighing up the system, see Linux or Windows VPS.
07
Frequently asked questions
How do I secure Remote Desktop on a Windows VPS?
Use an administrator account in your own name with a long password, keep Network Level Authentication on and restrict the Remote Desktop firewall rules to your IP addresses with Set-NetFirewallRule and -RemoteAddress. Add an account lockout policy and install updates every month.
Does a Windows Server VPS need an antivirus?
Microsoft Defender Antivirus is installed and enabled by default on Windows Server since version 2016. Check that it is running with Get-MpComputerStatus and that its definitions are up to date. A second antivirus is not needed and usually switches Defender to passive mode.
What if I have locked myself out of Remote Desktop?
Open the console from the customer area: it shows the VPS screen without going through Remote Desktop. Then fix the firewall rule, for example with -RemoteAddress Any, or wait for the lockout to end if your account was blocked.
Can the Administrator account be locked after failed sign-ins?
Only if the Allow Administrator account lockout policy is enabled, which depends on the installation: otherwise the built-in Administrator account is excluded from lockout. Working with your own administrator account, then disabling the original one, settles the question.
Is a snapshot enough as a backup?
No. A snapshot lets you roll back after a failed change, but it stays on the same infrastructure as the VPS. Keep a copy of your data off the VPS, somewhere else.