First of all, to all the "security" guys out there. Increasing functionality securely is the goal. Just turning all the computers off and disconnecting the internet is secure. Anyone can do that. A port number in TCP/IP is just an integer in a packet. It is NOT a new attack vector. Every protocol can run over any port, it is just a number. If you want to block something it requires more thought than just blocking a port. Ok, rant over.
In case your "security" guys think it makes sense to block outbound RDP on port 3389, I show here how we can still be functional and connect to an Azure Windows 10 VM via RDP.
You need to do 3 things and you have to be able to RDP into the system to do 2 of them. (So do from home or use Teamviewer to get out of your "secure" environment.):
- From Azure Portal Add Inbound Security Rule;
- We need to open the firewall to allow incoming connections to the new port.
Open windows Firewall on the Azure VM.
Add New Rule that allows incoming connection on port 3390 (Or any number not being used)
Last change the port on which Windows 10 is listening for RDP.
- go to HKEYLOCALMACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
- Change the decimal value to 3390
- Close Regedit
- Restart your VM. CAUTION: IF YOU DID ANYTHING WRONG YOU MAY NOT BE ABLE TO ATTACH TO THE VM.