How do I change the RDP listening port?

9

6

How do I change the port that I use to remotely access a Windows (7) computer?

Guy

Posted 2009-10-30T14:46:35.213

Reputation: 3 367

Answers

14

This Microsoft Support aticle gives the answer. Just change the following registry key:

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

Although this article does not call out Windows 7 specifically, it does work and is actually referenced by this RDP FAQ for Windows 7(see the last question).

heavyd

Posted 2009-10-30T14:46:35.213

Reputation: 54 755

7

I just use my firewall to redirect the port into my NAT instead of changing it on the internal windows system.

djangofan

Posted 2009-10-30T14:46:35.213

Reputation: 2 459

Doesn't Windows 7 need to be listening on that port for RDP connections? – Guy – 2009-12-12T16:13:46.547

1He's good, the remote firewall changes it back for him; he just forgot to mention that part (and he forgot to pretend it was useful) :-p – mrduclaw – 2009-12-12T18:10:05.610

im just saying that editing the registry is a little bit like re-inventing the wheel , which is why I think my method is easier and more logical. – djangofan – 2009-12-14T23:58:55.627

@djangofan, no, I do like the outside-the-box thinking on this. And it is nice to have a solution for when you don't have permissions to change the registry but you do somehow have permissions to change the network-wide firewall. – mrduclaw – 2009-12-15T01:38:07.773

3

Use the microsoft Fixit from this page to do it automatically:

http://support.microsoft.com/kb/306759

Eli

Posted 2009-10-30T14:46:35.213

Reputation: 332

1

As heavyd said in his answer you just need to update the registry.

However, what is better than listening on one alternate port? How about listening to an alternate port and the original port at the same time!

netsh interface portproxy add v4tov4 listenaddress=192.168.1.200 listenport=3389 connectaddress=192.168.1.200; connectport=12345

This will set up a forwarding rule for your machine that will redrect all incoming requests to the standard port 3389 to your new port (12345 in my example). Just be sure to change the two IP addresses to the IP address the machine you are running this on.

(I had to use this trick when I had a few servers that where NATed behind a single IP but I could not remap the ports like djangofan did during the NATing process, this let me use the alternate port on the public IP when connecting remotely or using the standard port or alternate port with the internal IP when I was on the LAN.)

Scott Chamberlain

Posted 2009-10-30T14:46:35.213

Reputation: 28 923