By default, Remote Desktop Protocol (RDP) connections use port 3389. This port is well-known among hackers, making it particularly vulnerable to automated attacks such as brute force—where scripts scan for open RDP ports and attempt to guess passwords until successful—and denial-of-service (DDoS) attacks that can slow down or even disable your server.
To make it more difficult for potential attackers and better protect your server, it’s recommended to change the default port to a custom, less predictable one.
In this guide, we’ll walk you through the process step by step.
Step 1: Connect to the Server and Open the Registry Editor
Connect to your server via Remote Desktop.
Click the Start menu and type in the search bar:
regedit
Press Enter to open the Registry Editor.
Step 2: Locate the RDP Port Setting
In the Registry Editor, navigate to the following path:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
Double-click the entry named PortNumber.
Step 3: Change the Port to a Custom Value
You will see the default value: 3389. Change it to another port, ideally between 20000 and 60000 (e.g., 45223).
Make sure the port you choose is not already in use by another application.
Select Decimal, then enter your new port number.
Click OK to save the change.
Important:
Make sure to remember your new port number, as you will need it to connect to the server later.
Step 4: Restart the Server
To apply the change, you need to restart your server:
Click Start → Restart,
or alternatively, restart the RDP service:
Open CMD as Administrator
(Click Start, type cmd, right-click it and select Run as Administrator)
Run the following command:
arduino
CopyEdit
net stop termservice && net start termservice
Step 5: Open the New Port in the OMC Firewall
Your newly selected port must be open in the firewall for the connection to work:
Log in to the OMC Cloud Management Interface and select your server.
Go to the Firewall tab.
Click Add Rule and configure a new rule:
Field
Recommended Setting
Direction
IN
Interface
ANY
Protocol
TCP
Source
Leave empty (or restrict to IP ranges)
Destination
Leave empty
Port
Your new custom port (e.g., 45223)
Policy
ACCEPT
Comment
"Custom RDP Port"
Click Add Rule, then Update Firewall to apply the changes.
Important:
Make sure the new port is open before disconnecting from your current session!
Step 6: Connect to the Server Using the New Port
Now, connect to your server as follows:
Open Remote Desktop on your local computer.
In the address field, enter your server’s IP followed by a colon and the new port:
203.0.113.5:45223
Click Connect, enter your username and password as usual, and log in.
Additional Security Tips:
Keep your new port number in a secure place.
Inform your users about the port change.
For enhanced security, consider using a VPN to access your servers.
You can set up alerts or monitor potential attacks via the OMC cloud interface.
Troubleshooting:
If you're unable to connect after the change:
Make sure the new port is open in both the OMC firewall and the Windows Firewall.
Double-check that you entered the new RDP format correctly: IP:port.
If you forgot the new port:
Use the Console Access in the OMC cloud interface to retrieve or fix the port setting.
Need Additional Help?
If you have any questions or issues configuring the new port, the OMC support team is available to assist you at any stage.