Monday, December 06, 2004

Setting Remote Desktop to an Alternate Port

The default port for Remote Desktop is 3389, but there are cases where it is useful to change this port, for example on the external interface of a firewall should you be providing remote support of said firewall. These steps are known to work on Windows XP and Windows Server 2003. They have not been tested by me on other versions of Windows.

On the Remote Desktop Server

  1. Start Registry Editor (Regedt32.exe).

  2. Locate the following key in the registry:

    HKEY_LOCAL_MACHINE\ System\ CurrentControlSet\ Control\ TerminalServer\ WinStations\ RDP-Tcp\ PortNumber

  3. On the Edit menu, click Modify, click Decimal, type the new port number, and
    then click OK.

  4. Quit Registry Editor.


On the Client

  1. Click Start, click All Programs, point to Accessories,
    point to Communications, and then click Remote Desktop Connection.

  2. In the Computer box, type the computer name or IP address of the
    computer to which you want to connect, followed by a colon (:) and the port
    number you want to use.

    For example, to connect to port 3390 on a computer named "MyXPPro,"
    type the following information: MyXPPro:3390

    To connect to port 3391 on a computer with IP address 10.10.10.1,
    type the following information: 10.10.10.1:3391

More information at

http://support.microsoft.com/default.aspx?scid=kb;en-us;306759
and

http://support.microsoft.com/default.aspx?scid=kb;en-us;304304

7 comments:

Anonymous said...

This info was really helpful and straight to the point! Thank you!

Anonymous said...

Did you know the Windows Server Administration Tools Pack provides a new MMC plugin to easily manage multiple servers, and also supports accessing servers on alternate RDP ports.

http://www.kevinlewisblog.com/server/remote-desktops-mmc-with-alternate-rdp-port/

Tina said...

Do you know if this works in Windows 7? I've been trying to get this to work there and haven't had much luck.

I opened up port 12394 on my router that points to the local IP address of the machine I want to connect to from a remote location. I've also pointed that port in the registry settings for RDP.

On the machine I use from my remote location, I then type the IP address to the firewall followed by a colon, followed by the new port number. I get a generic "can't connect" message.

If I do the exact same thing with a Windows XP machine, no problems.

Unknown said...

Tina,
Check your firewall exceptions. Windows FW configuration has changed dramatically in Win7 and may require a bit more tweaking than before. Start by disabling to test yiour config, then turn it back on and work from there to open the port you are using.

Unknown said...

Great! This is a very useful information. I am in charge with the IT department in our company and I always do remote access whenever I need files back home.

assistenza computer

Anonymous said...

Here is a good hypothetical for you:

Say I have a server with 2 internal I.P. address of 192.168.1.68 and 192.168.1.69 and my current port forwarding configuration on my router is to have port 3389 (Default port) point to 192.168.1.69 if I enter r1.mywebsite.com as the address. If I change my registry value to allow the alternative port and set my port forwarding over to have r2.mywebsite.com point to 192.168.1.68 will this disable the default port? Can I have 2 ports for 2 simultaneous connections on one machine with 2 I.P. addresses?

ed pills online said...

I'm amazed, I must say. Rarely do I encounter a blog that's both equally educative and amusing, and let me tell you, you have hit the nail on the head. The issue is something which too few people are speaking intelligently about. I am very happy that I came across this during my hunt for something concerning this.