Azure Virtual Machine not accessible after RDP por

2019-07-25 17:59发布

问题:

I've changed RDP port to 8080 in registry on my Azure Virtual Machine (Windows Server). Now it is not accessible from outside, I cant connect it.

Azure VM is managed by Resource Manager (not Classic VM).

UPDATE:

Turning secuiruty rules so allow all not helped.

回答1:

I've changed RDP port to 8080 in registry on my Azure Virtual Machine (Windows Server)

We can use CustomScriptextension to check if RDP listening on port 8080.

netstat -ant | findstr "8080"

If your port not listening on Port 8080, we may need to restart RDP service.

If RDP listening on port 8080, we can use CustomScriptextension to disable windows firewall.
netsh advfirewall set allprofiles state off

About Extension, we create a ps1 file with the command, and upload it via Azure portal.



回答2:

Azure has to know to allow traffic through to your VM. By default, on a Windows VM, only RDP is open. But you (for some reason) changed the RDP port in Windows Server. You need to do this with the network interface as well, via the VM settings (which has nothing to do with Windows itself):

  • Via Settings, go to Network Interfaces
  • Select your network interface and go to Network Security Group
  • From network security group, add an inbound rule for port 8080 (or modify the existing RDP rule to be port 8080).


回答3:

It used to be possible to change your RDP port in Classic portal using endpoints. but in RM portal you cannot change your RDP port.

If you are trying to secure your box or by pass the security firewall to connect to your box, I recommend using Azure Load Balancer NAT rules, you can create a NAT rule to translate a custom port to 3389, and then you can only allow connectivity from LB to your VM, this a trick I use when I want to by pass the corporate's firewall, for example port 443.

Make sure you attach the LB to your VM from the NAT rule section