+3 votes
413 views
Change remote desktop port Windows Server 2019

in WindowsServer by (552k points)
reopened | 413 views

1 Answer

+4 votes
Best answer

Change Remote Desktop port in Windows Server 2016 or 2019

Windows Server 2016 or 2019 gives us the opportunity to manage the server and its processes remotely through the remote desktop function, this function allows us to access the server and perform administrative or support tasks there..

 

By default Windows 10 uses port 3389 for this connection and as it is a default port, it can be used by attackers to connect to the server and perform unauthorized actions there. This can have consequences for the entire structure of the Windows Server as well as for the data of users and administrators. A good practice that we can do by modifying this port and that is why TechnoWikis will explain how to do it in Windows Server 2019 or 2016.

 

 

 

To stay up to date, remember to subscribe to our YouTube channel!   SUBSCRIBE

 

Change Remote Desktop port in Windows Server 2016 or 2019

 

Step 1

The first thing will be to enable the remote desktop function, for this we open the Server Manager and go to the "local server" section, we will see the following:

 

image

 

Step 2

We click on the "Disabled" line in "Remote Desktop" and in the displayed window we must enable the remote desktop, for this we activate the "Allow remote connections to this computer" box.

 

image

 

Step 3

Click on Apply and OK to complete the process, we validate that the remote desktop has been enabled:

 

image

 

 

Step 4

After this we access the registry editor by entering the word "regedit" in the Windows Server search box:

 

image

 

 

Step 5

In the editor we must go to the following route:
 HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server \ WinStations \ RDP-Tcp 
image

 

 

Step 6

There we locate the DWROD value called "PortNumber", we right click on it and select "Modify" in the pop-up window, we activate the "Decimal" box and we can see the default port value which is 3389:

 

image

 

 

Step 7

There we enter the new port to use for remote desktop connections:

 

image

 

 

Step 8

We click OK and check that the change has been applied:

 

image

 

 

Step 9

It is time to configure the Firewall in Windows Server to authorize the connection through that port, for this we enter "control" in the search box and select "Control Panel":

 

image

 

 

Step 10

In the Control Panel we go to the "View by" field and select "small icons":

 

image

 

 

Step 11

We click on "Windows Defender Firewall" and the following will be opened:

 

image

 

 

Step 12

We click on "Advanced Settings" and go to the "Inbound Rules" section:

 

image

 

 

Step 13

There we click on "New rule" and the following wizard will open where we first activate the "Port" box:

 

image

 

 

Step 14

We click Next and select the TCP protocol and enter the port number:

 

image

 

 

Step 15

We click Next and now we allow the connection through this port:

 

image

 

 

Step 16

In the next window we must define in which profiles this entry rule must be active in the domain and server:

 

image

 

 

Step 17

Click Next and assign a name for the rule to create:

 

image

 

 

Step 18

We click on "Finish" and we will see the new input rule created correctly:

 

image

 

 

Step 19

To apply the changes we must restart the Windows Server 2016 or 2019 server:

 

image

 

 

Step 20

Once we log in, we open the command prompt and execute "ipconfig" to find the IP address of the server:

 

image

 

 

Step 21

To check that everything works correctly, we go to Windows 10, we open Run and there we enter "mstsc" which is the command to access the remote desktop:

 

image

 

 

Step 22

We click on accept and in the pop-up window we enter the IP of the Windows Server 2016 or 2019 followed by the port we have assigned:

 

image

 

 

Step 23

We click on "Connect" and we must enter server administrator credentials:

 

image

 

 

Step 24

We click OK and we will see a warning about the remote connection:

 

image

 

Step 25

We click Yes and we will see that it is possible to connect to Windows Server using the port that we have established:

 

image

 

 

It is a really simple process to change the remote access port to Windows Server through remote desktop, but it is advisable to do it for a security issue to prevent attackers who know the IP for some reason from using the default port for access. remote..

 


by (3.5m points)

Related questions

+3 votes
1 answer
asked Feb 17, 2021 in WindowsServer by backtothefuture (552k points) | 307 views
+5 votes
1 answer
asked Feb 1, 2021 in WindowsServer by backtothefuture (552k points) | 397 views
+4 votes
1 answer
asked Oct 8, 2019 in Windows Server by backtothefuture (552k points) | 322 views
+4 votes
1 answer
+3 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users