Home News Alert Revamping RDP Port Access- Strategies for Modifying Ports in Remote Desktop Connections

Revamping RDP Port Access- Strategies for Modifying Ports in Remote Desktop Connections

by liuqiyue

How do you alter ports that accept RDP? Remote Desktop Protocol (RDP) is a widely used protocol for accessing a computer remotely. By default, RDP uses port 3389, which can be a security risk if left unchanged. In this article, we will discuss the steps to alter the RDP port on both Windows and Linux systems to enhance security and prevent unauthorized access.

1. Changing the RDP Port on Windows:

1.1. Open the Remote Desktop settings:

To begin, open the Remote Desktop settings on your Windows machine. You can do this by searching for “Remote Desktop” in the Start menu and selecting “Remote Desktop Settings” from the search results.

1.2. Access the System Properties:

In the Remote Desktop settings window, click on the “Options” button. Then, select the “Advanced” tab and click on the “Settings” button under the “RDP” section.

1.3. Change the port number:

In the “RDP-Tcp port” field, enter the new port number you want to use for RDP. Make sure the port number is not already in use by another application. After entering the new port, click “OK” to save the changes.

1.4. Configure the Windows Firewall:

To ensure that the new RDP port is accessible, you need to configure the Windows Firewall. Go to the Control Panel and open the “Windows Firewall” settings. Click on “Change settings” and enable the “Allow an app or feature through Windows Firewall” option. Scroll down and select “Remote Desktop” from the list of allowed apps. Make sure to check the box next to the new port number you just entered.

1.5. Restart the Remote Desktop service:

Finally, restart the Remote Desktop service to apply the changes. You can do this by opening the Command Prompt as an administrator and typing the following command: “net stop mstsc /y” followed by “net start mstsc”.

2. Changing the RDP Port on Linux:

2.1. Install xrdp:

First, install the xrdp package on your Linux system. The installation command varies depending on the distribution you are using. For example, on Ubuntu, you can install xrdp by running the following command: “sudo apt-get install xrdp”.

2.2. Configure xrdp:

After installing xrdp, you need to configure it to use a different port. Open the xrdp configuration file, usually located at “/etc/xrdp/xrdp.ini”, using a text editor. Look for the “port” line and change the port number to your desired value.

2.3. Configure the Linux Firewall:

Similar to Windows, you need to configure the Linux firewall to allow connections on the new RDP port. On Ubuntu, you can use the “ufw” command to do this. Run the following command: “sudo ufw allow from any to any port [new_port]/tcp”. Replace [new_port] with the actual port number you have set for RDP.

2.4. Restart the xrdp service:

Finally, restart the xrdp service to apply the changes. You can do this by running the following command: “sudo systemctl restart xrdp”.

By following these steps, you can alter the RDP port on both Windows and Linux systems to enhance security and prevent unauthorized access. Remember to choose a port number that is not commonly used and is not already in use by another application.

Related Articles