how to change remote desktop port

Are you aware of the notorious BlueKeep vulnerability? It exploited port 389 by sending a specially-crafted message that enabled the hackers to run any kind of code remotely on compromised systems. Given the security threat that RDP poses, it is advised to turn off RDP when it’s not necessary, but there are certain times when you buy Windows VPS hosting to use it all the time. You can’t just use the remote desktop. However, there are ways to change the RDP port number from its default number.

It won’t necessarily make your Windows system totally secure; however, it will aid in stopping some hackers who use scripts. In this article, we’ll go over how to change the remote desktop connection port and why it is necessary to do so.

 

Remote Desktop Remote Access

Windows operating systems have an integrated Microsoft Remote Desktop, a client program that allows users to connect and access resources as well as documents on remote computers through the Internet.

 

How Do They Work?

Let’s say you have just bought the best Windows VPS hosting service. When you begin an online desktop session, your computer transmits a signal to the host computer through an open port 3389, asking for permission for connection. The host computer asks for login credentials, compares them against the list of remote desktop users that have been configured and then grants permission.

Once you’ve logged into the system, the listening port relays your mouse and keyboard motions to your host’s computer. It then collects and displays the information from the host computer to your computer. It’s almost like the remote computer trying to work with it! All this is due to the back-and-forth communication via your listening ports.

But be aware that hosts allow only just one connection from a remote device at a given time. If a user tries to connect to the host’s computer or connect to it via a different device, then the remote connection will be lost.

As you can probably tell, it is clear that listeners’ ports play an essential element in remote desktops.

In certain ways, the importance of listening ports can be an area of vulnerability for hackers, as they can gain access to the listening port and connect to computers from afar.

 

Why Should You Change the Default RDP Port on Windows?

Microsoft utilizes an industry-standard port number 3389 to connect to remote connections in general, and it’s no secret. There are many instances where hackers use the listening port 3389 in order to access remote computers and employ the system of automated authentication to obtain access. These are known as “password spraying” and brute force attacks similar to the one recently discovered by Microsoft.

This is certainly an extremely serious security flaw that could expose your remote system to hackers.

To mitigate this vulnerability, administrators are often able to change the RDP port’s number to a different port that is free, making it difficult for hackers to detect the port that RDP is listening to.

Apart from protecting themselves from hackers, administrators can also change their RDP port numbers in order to be able to bypass firewalls.

To protect themselves, certain firewalls in systems are configured to block both outgoing and inbound messages sent to and from port 3389 and vice versa. This is done to block hackers from signing into the port, rather as opposed to blocking remote access.

 

How to Change the Remote Desktop Port on Windows 10

how to change rdp port

Now that you know the importance of changing the default port, you may get right into it as soon as possible.

Generally speaking, there are two methods that you can use to change the port number; whether you buy Windows VPS hosting or your personal computer, you can use either the registry or PowerShell to do so.

While neither is superior to the other, it’s much more of a personal choice. If you are familiar with PowerShell and would prefer getting things done with code, then this is the way to go.

 

Using Windows Registry

This is a step-by-step tutorial on changing the remote desktop port in Windows 10.

Select Windows + R to open the Run dialog box. Type Regedit to start the editor for the registry.

  •     Navigate to HKEY_LOCAL_MACHINESystemCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp.
  •     Look for Port Number.
  •     Click Edit > Modify.
  •     Then enter the number of the newly opened port, then click OK.
  •     Stop the registry.
  •     Make sure to restart your system.

If your remote computer is running a firewall, be sure that you configure it in order to permit connections through the latest port number.

 

How to Change Remote Desktop Port on Windows Server 2016

It’s strongly recommended to change the Windows remote desktop’s default port to ensure security.

You can change the RDP port by following these steps. Firstly, you’ll have to change the port and then define the port in the firewall rule.

Change the remote desktop connection port:

  •     The registry editor can be opened using the search function Regedit in the Windows search box or using Run.
  •     Find the following in the regedit application:

HKEY_LOCAL_MACHINESystemCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp

  •     Search for the PortNumber and then right-click it and alter it.
  •     Be sure to choose Decimal under the Base option
  •     Switch the port’s port to whatever number you like. Let’s say 4545 and then click OK.
  •     Stop using the registry editor.
  •     Open Firewall (Windows Defender Firewall with Advanced Security)
  •     From the left sidebar, click on Inbound Rules.
  •     From the right sidebar, click on New Rule.
  •     Choose a Port Click Next
  •     Choose the TCP port and enter the port number into the local port you want to use, then click the next button until you arrive at the section where you need to input a name for the rule and give the rule a title and click to finish. (Repeat from #7 until #11 to use UDP)
  •     Try connecting via RDP as normal, but when you type in the IP, make sure to enter the custom port number following the IP with this format IP:Port (e.g., 211.111.1.5:4545)

 

PowerShell

You can also alter your RDP port by using one of the below PowerShell commands. With this option, you’ll indicate our current RDP port number as 4545.

To add the new RDP Port in the Registry:
Set-ItemProperty -Path ‘HKLM:SYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp’ -name “PortNumber” -Value 4545
 

Then add a Firewall Rule to open port 1234 in the Public profile by using PowerShell

New-NetFirewallRule -DisplayName ‘RDPPORT_TCP’ -Profile ‘Public’ -Direction Inbound -Action Allow -Protocol TCP -LocalPort 4545

 

Now restart the server using the following script:

Restart-Service -Force -DisplayName “Remote Desktop Services”

 

Conclusion

In short, when you buy a Windows VPS server, you may want to connect to it using the RDP. RDP helps to connect to remote devices, and all communications between devices occur via listening ports. In particular, port 3389 is the one used as a default port for remote connections.

However, hackers may employ techniques of brute force attack to gain access to remote devices via the default port. Therefore, many security professionals and administrators prefer changing the port number in order to make it more difficult for hackers to gain access to remote devices. Sometimes, this modification is needed to bypass firewalls too.

Understanding RDP Ports and Their Importance

Remote Desktop Protocol (RDP) ports play a crucial role in enabling remote connections to your server. By default, RDP uses port 3389, which can be a security risk if left unchanged. Understanding how to modify this port can enhance your server’s security and performance.

Step-by-Step Guide to Changing the RDP Port

  • Backup Your Registry: Before making any changes, ensure that you back up your registry to prevent data loss.
  • Open Registry Editor: Press Win + R, type regedit, and hit Enter.
  • Navigate to Key: Go to HKEY_LOCAL_MACHINESystemCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp.
  • Modify Port Number: Find the PortNumber key, double-click it, switch to Decimal, and enter your new port number.
  • Restart Your Server: For changes to take effect, restart your server.

RDP Port Comparison Table

Port Number Common Use Security Level
3389 Default RDP Low
Custom Port Custom RDP High

FAQ

What is the default RDP port number?

The default RDP port number is 3389. This is commonly used for remote desktop connections but can be changed to enhance security.

Why should I change the RDP port?

Changing the RDP port can help protect your server from unauthorized access and reduce exposure to potential cyber threats.

Can changing the RDP port affect server performance?

Changing the RDP port does not typically affect server performance. However, it can improve security by reducing the risk of unauthorized access.

For a more secure and reliable server experience, consider exploring our VPS hosting solutions that offer enhanced security features and flexibility.

Understanding the Importance of Changing the Default RDP Port

Changing the default RDP port from 3389 to another port is a critical security measure. The default port is a well-known target for attackers attempting unauthorized access through brute force attacks. By altering this port, you reduce the risk of such attacks, as it adds an additional layer of obscurity and security to your remote desktop connections.

Moreover, adjusting the RDP port can help in avoiding conflicts with other services or applications that might also use port 3389. This is particularly useful in environments where multiple remote desktop services are running, as it ensures that each service operates without interference, leading to improved stability and performance.

Best Practices for Selecting a New RDP Port

When selecting a new RDP port, it’s essential to choose a port number that minimizes security risks and avoids conflicts with other applications. Here are some best practices to guide you:

  • Choose a Non-Standard Port: Opt for a port number above 1024, as ports below this range are well-known and commonly used by standard services.
  • Avoid Well-Known Ports: Steer clear of ports that are widely recognized or commonly associated with other services to prevent potential conflicts.
  • Document Your Changes: Keep a detailed record of the new port number and any related configuration changes for future reference and troubleshooting.

By following these best practices, you can enhance the security and functionality of your remote desktop services, ensuring a more robust and secure setup.

Troubleshooting Common Issues After Changing the RDP Port

Changing the RDP port can sometimes lead to connectivity issues. Here are some common problems and their solutions:

  • Firewall Configuration: Ensure that your firewall settings allow traffic through the new RDP port. This may involve creating a new rule to permit inbound connections on the specified port.
  • Router Port Forwarding: If you’re connecting remotely, verify that your router is correctly configured to forward traffic from the new port to the internal IP address of the server.
  • DNS and IP Address Changes: If you’ve recently changed DNS settings or IP addresses, ensure that your RDP client is updated with the correct information to prevent connection failures.

By addressing these common issues, you can ensure a smooth transition and maintain reliable remote desktop connectivity.

Comparing RDP Port Alternatives and Their Impact on Security

While changing the RDP port is an effective security measure, it’s important to consider alternative approaches and their implications:

Alternative Security Impact Implementation Complexity
VPN High – Encrypts traffic and adds a layer of authentication Moderate – Requires VPN server setup and client configuration
SSH Tunneling High – Provides encrypted tunnels for RDP traffic Moderate – Involves configuring SSH server and clients
Two-Factor Authentication High – Adds an extra layer of security beyond passwords Low – Can be easily integrated with existing RDP setups

These alternatives can be used in conjunction with changing the RDP port to create a more secure remote access environment, balancing security needs with the complexity of implementation.

Understanding the Importance of Changing the RDP Port

While Remote Desktop Protocol (RDP) is an essential tool for remote access, it is also a common target for cyber-attacks. By default, RDP uses port 3389, which is widely known and often scanned by malicious actors. Changing the RDP port can significantly enhance your server’s security by reducing the risk of unauthorized access.

Changing the default RDP port adds an additional layer of security through obscurity. Although not a foolproof security measure, it can deter automated attacks and reduce the attack surface. This simple adjustment can be particularly beneficial for servers exposed to the internet, where the volume of port scans is high.

Additionally, altering the RDP port can help in managing network traffic more efficiently. By using a non-standard port, you can avoid conflicts with other services and improve the overall performance and reliability of your server environment.

Step-by-Step Guide to Changing the RDP Port

Changing the RDP port involves a few straightforward steps that can be completed with administrative privileges on the server. Below is a detailed guide to help you through the process:

  • Open the Windows Registry Editor by typing regedit in the Run dialog box.
  • Navigate to the following registry subkey: HKEY_LOCAL_MACHINESystemCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp.
  • Find the PortNumber entry, right-click it, and select Modify.
  • Select Decimal and enter the new port number. Ensure it is not already in use or reserved by other applications.
  • Close the Registry Editor and restart the server for the changes to take effect.

After changing the port, remember to update any firewall rules or security groups to allow traffic through the new port. This ensures that remote connections can still be established without interruptions.

Best Practices for Selecting a New RDP Port

When choosing a new port for RDP, consider the following best practices to ensure both security and functionality:

  • Avoid Common Ports: Steer clear of commonly used ports such as 80, 443, or 22 to prevent potential conflicts and avoid attracting unwanted attention from attackers.
  • Use High-Numbered Ports: Opt for ports above 1024, as these are less likely to be used by other services. Ports in the range of 49152 to 65535 are generally considered safe for custom applications.
  • Regularly Update Port Configurations: Periodically review and update your port configurations to adapt to changing security landscapes and maintain optimal server security.

By adhering to these practices, you can effectively minimize security risks and maintain a robust remote access setup.

Troubleshooting Common Issues After Changing the RDP Port

After changing the RDP port, you may encounter connectivity issues. Here are some common problems and their solutions:

  • Firewall Blocks: Ensure that your firewall settings are updated to allow traffic on the new port. Check both server-side and network-level firewalls for any rules that might block the new port.
  • Incorrect Port Configuration: Double-check the registry settings to confirm that the correct port number has been entered. Any discrepancies can prevent successful remote connections.
  • Network Address Translation (NAT) Issues: If your server is behind a NAT device, ensure that port forwarding is configured correctly to direct traffic from the external network to the new RDP port on your server.

If these solutions do not resolve the issue, consider consulting your network administrator or IT support team for further assistance. Proper troubleshooting can help restore seamless remote access while maintaining the security benefits of a non-standard RDP port.

Leave a Reply

Your email address will not be published. Required fields are marked *

Count: 74 - Average: 4.7

Rating Submitted.