Open port for Remote Desktop Windows Server 2022

How to Enable & Disable Remote Desktop Protocol (RDP) on Windows Cloud Servers

2020-05-21 By Ryan 26302 Views windows RDP networking
4 reviews

RDP (Remote Desktop Protocol) is the protocol that allows a user to connect to a Windows Server through a graphical interface over any network.


Open port for Remote Desktop Windows Server 2022


This guide will describe the steps to enable and disable Remote Desktop service in the Windows server through the graphical interface as well as Windows Powershell.




Enable RDP through graphical interface



  1. Click on Start Menu button and then on Server Manager.

    Open port for Remote Desktop Windows Server 2022

  2. In the Server Manager window, click on Local Server in the left side panel and wait for few minutes for the server status to get refreshed. The Remote Desktop option will be shown as Disabled in Windows 2019 version.

    Open port for Remote Desktop Windows Server 2022

  3. Click on the Disabled option and this will open up the Remote tab in the System Properties window.

    Open port for Remote Desktop Windows Server 2022

    NOTE: The System Properties window can also be accessed from Control Panel option by clicking on System and then on Remote settings in the left panel or from the Windows command prompt by executing the below command.

    > SystemPropertiesRemote

    Open port for Remote Desktop Windows Server 2022

    Open port for Remote Desktop Windows Server 2022

  4. From under Remote Desktop section, select the option Allow remote connections to this computer.

    The sub-option Allow connections only from computers running Remote Desktop with Network Level Authentication (recommended) can be left enabled or disabled, depending upon the machines from which Remote Desktop connection is being established to the server. If the local machine is Linux-based, then this option needs to be disabled.

    Open port for Remote Desktop Windows Server 2022

  5. Once this option Allow remote connections to this computer is selected, a warning message window will appear notifying the user that the required firewall rules will be enabled in the server for allowing Remote connections to the server from any source network. Click on OK to proceed.

    Open port for Remote Desktop Windows Server 2022

  6. Click on OK in the System Properties window to complete the process of enabling Remote Desktop in the server.

  7. The status of the Remote Desktop service can now be confirmed back from Server Manager, where it will show as Enabled once the Server Manager is refreshed.

    Open port for Remote Desktop Windows Server 2022




Enable RDP through Windows Powershell



  1. The registry value that enables/disables Remote Desktop can be modified using the Set-ItemProperty cmdlet.

    > Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0

    Open port for Remote Desktop Windows Server 2022

  2. Once this is completed, the Enable-NetFirewallRule cmdlet can be used to set the Windows firewall to allow remote desktop connections.

    > Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

    Open port for Remote Desktop Windows Server 2022




Testing allowed Remote Desktop connection service

Once Remote Desktop is enabled in the server, remote connections to the server can be tested using the Remote Desktop Connection app (Windows) or the rdesktop command (Linux).


Windows:


  1. Click on Start Menu option and search for Remote Desktop Connection and click on the application.

  2. Type in the IP address of the server that needs to be connected to remotely in the Computer field and then click on Connect.

    If the server has any custom RDP port, then the IP needs to be typed in the below format (replace 123.123.123.123 with the exact server IP address and 1234 with the custom port number).

    123.123.123.123:1234

    Open port for Remote Desktop Windows Server 2022

  3. Type in the username and associated password with which the server is to be accessed remotely in the Windows Security window and then click on OK to connect to the server remotely.

    Open port for Remote Desktop Windows Server 2022


Linux:

In all Linux distributions, the most common command that can be used to connect to the remote desktop of a server is rdesktop. Another command that can be used is xfreerdp.


  1. Type in the below command in the Linux command line to remotely connect to a server with the rdesktop command (replace 123.123.123.123 with the exact IP address of the server).

    # rdesktop 123.123.123.123
  2. Once the command is entered, a remote desktop connection window will appear, in which the username and associated password are to be entered to access the server remotely.

    Open port for Remote Desktop Windows Server 2022




Disable RDP through graphical interface



  1. Access the server and Click on Start Menu button and then on Server Manager.

    Open port for Remote Desktop Windows Server 2022

  2. In the Server Manager window, click on Local Server in the left side panel and wait for few minutes for the server status to get refreshed. The Remote Desktop option will be shown as Enabled.

    Open port for Remote Desktop Windows Server 2022

  3. Click on the Enabled option and this will open up the Remote tab in the System Properties window.

    Open port for Remote Desktop Windows Server 2022

    NOTE: The System Properties window can also be accessed from Control Panel option by clicking on System and then on Remote settings in the left panel or from Windows command prompt by executing the below command.

    > SystemPropertiesRemote

    Open port for Remote Desktop Windows Server 2022

    Open port for Remote Desktop Windows Server 2022

  4. From under Remote Desktop section, select the option Dont allow remote connections to this computer.

    Open port for Remote Desktop Windows Server 2022

  5. Click on OK to proceed.

  6. The status of the Remote Desktop service can now be confirmed back from Server Manager, where it will show as Disabled once the Server Manager is refreshed.

    Open port for Remote Desktop Windows Server 2022




Disable RDP through Windows PowerShell



  1. The registry value that enables/disables Remote Desktop can be modified using the Set-ItemProperty cmdlet.

    > Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 1

    Open port for Remote Desktop Windows Server 2022


Testing restricted Remote Desktop connection service

Once Remote Desktop is disabled in the server, remote connections to the server can be tested using the Remote Desktop Connection app.


Windows:


  1. Click on Start Menu option and search for Remote Desktop Connection and click on the application.

  2. Type in the IP address of the server that needs to be connected to remotely in the Computer field and then click on Connect.

    If the server has any custom RDP port, then the IP needs to be typed in the below format (replace 123.123.123.123 with the exact server IP address and 1234 with the custom port number).

    123.123.123.123:1234

    Open port for Remote Desktop Windows Server 2022

  3. The warning message will receive as shown below.

    Open port for Remote Desktop Windows Server 2022


  • Microsoft Remote Desktop Services (CAL Users)


  • How to Enable & Disable SSH login on Linux Cloud Servers

  • How to check if TCP / UDP port is open on Linux & Windows Cloud Servers

  • Installing telnet client on Linux and Windows Cloud Servers

  • How to enable & disable Ping (ICMP Echo Requests) from IPTables on Linux Cloud Servers

  • How to enable & disable Ping (ICMP Echo Requests) in Windows Server 2019 Firewall

  • How to Enable & Disable Ping (ICMP Echo Requests) in Windows Server 2022 Firewall

  • How to change Remote Desktop (RDP) port on Windows Cloud Servers

  • How to resolve RDP authentication error due to the CredSSP encryption oracle remediation on Windows OS

What do you think about this article?

Rate this article
5 4 3 2 1