Your Windows account keeps locking? Bots scan the internet and guess passwords on the default RDP port 3389. This tutorial explains the mechanism and how to change the Remote Desktop port for stable access.
See also: Connect via RDP Β· Secure RDP
π Prerequisites
- Windows VPS with Administrator access (active RDP session)
- Working RDP connection before changes
What is going on?
The default RDP port is 3389. Bots know it and scan it continuously. After many failed login attempts, Windows locks the account.
Default RDP port (3389) β attack in progressInternet botsadmin / 123456βadmin / passwordβadmin / qwertyββ¦ Γ 500 attemptsβWindows VPSPort 3389Account lockedYouConnection deniedConnection denied
After changing the port, bots no longer find RDP on 3389:
Custom port (e.g. 3390) β bots blockedInternet botsPort 3389Port closedScan fails
YouPort 3390Windows VPSConnected
Step 1 β Change the port in the registry
Open PowerShell as Administrator:
PowerShellSet-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name PortNumber -Value 3390
Replace 3390 with your chosen port (1024β65535).
Via regedit:
Win + Rβregedit- Go to
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp - Double-click PortNumber β select Decimal β enter
3390β OK
Step 2 β Open the new port in the firewall
PowerShellNew-NetFirewallRule -DisplayName "RDP Custom Port" -Direction Inbound -Protocol TCP -LocalPort 3390 -Action Allow
See also: open a Windows firewall port.
Step 3 β Restart the RDP service
PowerShellRestart-Service TermService -Force
Step 4 β Connect with the new port
In Remote Desktop, use:
TEXTYOUR_IP:3390
Example: 82.26.157.98:3390
β οΈ Do not close your current session until the new port works.
Step 5 β Block the old port (optional)
After confirming the new connection:
PowerShellNew-NetFirewallRule -DisplayName "Block RDP 3389" -Direction Inbound -Protocol TCP -LocalPort 3389 -Action Block
Verify
PowerShellnetstat -an | findstr "3390"
Expected:
TEXTTCP 0.0.0.0:3390 0.0.0.0:0 LISTENING
Go further
Restrict access to your fixed public IP only:
PowerShellNew-NetFirewallRule -DisplayName "RDP My IP" -Direction Inbound -Protocol TCP -LocalPort 3390 -RemoteAddress "YOUR_IP_HERE" -Action Allow New-NetFirewallRule -DisplayName "RDP Block Rest" -Direction Inbound -Protocol TCP -LocalPort 3390 -Action Block
Only if your IP is static β otherwise you may lock yourself out.
Our Windows VPS are available in the same 8 locations: Windows VPS France, Windows VPS Germany, Windows VPS Netherlands, Windows VPS United Kingdom, Windows VPS USA, Windows VPS Canada, Windows VPS Turkey and Windows VPS Hong Kong. Desktop editions are offered too: Windows 10 RDP and Windows 11 RDP.
To get an RDP server directly: Buy RDP, Cheap Windows RDP and Streaming RDP.
Summary
| Action | Command |
|---|---|
| Change port | Set-ItemProperty -Path "HKLM:\...\RDP-Tcp" -Name PortNumber -Value 3390 |
| Open firewall | New-NetFirewallRule ... -LocalPort 3390 -Action Allow |
| Restart RDP | Restart-Service TermService -Force |
| Verify | netstat -an | findstr "3390" |
| Block old port | New-NetFirewallRule ... -LocalPort 3389 -Action Block |
Secure RDP access! π