Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Change the RDP Port in Windows for Secure Remote Access

How to Change the RDP Port in Windows for Secure Remote Access

Changing the default Remote Desktop Protocol (RDP) port in Windows can enhance your system’s security by making it less obvious to potential attackers. While the default port is 3389, customizing it reduces the risk of automated attacks and unauthorized access. Before proceeding, ensure you have administrative rights on your Windows machine, and be aware that modifying system settings can have unintended consequences if not done carefully. Also, remember to update your firewall rules to reflect the new port to maintain remote access functionality.

What You’ll Need

  • Administrative access to the Windows PC you want to configure
  • Basic familiarity with Windows Registry Editor
  • Access to Windows Firewall settings
  • Optional: a remote client with Remote Desktop Connection configured

Step-by-Step

  1. Open the Registry Editor: Press Windows + R, type regedit, and press Enter. Confirm any User Account Control prompts to proceed.
  2. Navigate to the RDP Port Registry Key: In Registry Editor, go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp.
  3. Locate the PortNumber value: Find the PortNumber DWORD entry. By default, it is set to 3389.
  4. Edit the PortNumber value: Double-click PortNumber. Select the Decimal radio button and enter your desired port number (e.g., 3390). Ensure the port number is above 1024 and not in use by other services.
  5. Save the changes: Click OK, then close the Registry Editor.
  6. Update Windows Firewall rules: Open Windows Defender Firewall with Advanced Security. Navigate to Inbound Rules, find the rule for Remote Desktop, and modify its properties to allow traffic on the new port. If no rule exists, create a new inbound rule:
    • Click New Rule
    • Select Port, click Next
    • Choose TCP, specify the new port number, click Next
    • Allow the connection, click Next
    • Choose applicable profiles, click Next
    • Name the rule (e.g., RDP Custom Port), click Finish
  7. Configure your Remote Desktop client: When connecting, specify the IP address followed by a colon and the new port number (e.g., 192.168.1.10:3390). Some clients may require the port to be specified explicitly or via command-line options.
  8. Restart the Remote Desktop service (optional): To ensure changes take effect, restart the Remote Desktop service or reboot your computer.

Common Mistakes

  • Not backing up the registry before making changes, risking system instability.
  • Choosing a port number that conflicts with other services or is below 1024.
  • Failing to update firewall rules, which can block remote connections on the new port.
  • Forgetting to specify the port when connecting via the Remote Desktop client.
  • Modifying the wrong registry key or value, leading to failed RDP connections.

Tips

  • Always create a system restore point before editing the registry, so you can revert if needed.
  • Choose a port number above 1024 and outside common service ranges to reduce conflicts.
  • Test the new port locally before trying remote connections to verify changes.
  • Document the new port number and firewall rules for future reference.
  • If you use a dynamic IP, consider setting up Dynamic DNS for easier access.

Troubleshooting

If you cannot connect after changing the RDP port, follow these steps:

  • Verify the port number: Make sure you are specifying the correct port in your RDP client.
  • Check firewall rules: Ensure that inbound rules allow traffic on the new port. Disable any conflicting rules.
  • Test network connectivity: Use tools like telnet or PowerShell to test if the port is open and listening:
    Test-NetConnection -ComputerName  -Port 
  • Reboot your system: Sometimes changes require a restart to take effect.
  • Revert changes: If issues persist, restore the registry backup or revert the port change to 3389.

Frequently Asked Questions

1. Can I change the RDP port to any number?

Yes, but it’s recommended to choose a port number above 1024 that is not already used by other services to avoid conflicts.

2. Will changing the RDP port affect other network services?

It can, especially if other services also use the same port. Always check for conflicts before assigning a new port.

3. Do I need to open the new port on my router?

Yes, if you connect over the internet, you must forward the new port in your router’s port forwarding settings.

4. Is changing the RDP port secure?

Changing the port adds a layer of obscurity but should not be relied upon solely for security. Use strong passwords, network restrictions, and VPNs for better protection.

5. How do I revert the port change if I encounter issues?

Reopen the Registry Editor, set the PortNumber value back to 3389, and update your firewall rules accordingly. Restart your PC to apply changes.

}

Related

How to Change the RDP Port in Windows for Secure Remote Access
Scroll to top