简体   繁体   中英

Unable to connect to Azure VM after changing RDP Port to 443

I have set up an Azure virtual machine running Windows 10 Client. As per the below post I changed the RDP Port to 443 but didn't add the VM Firewall Rule and restarted the VM. New Azure portal (no End Points) how to connect to VM with RDP from behind a firewall Now I am unable to connect to my Azure VM. I tried the following things 1) Unable to connect to remote Powershell since WinRM is disabled. I tried enabling it but somehow not working 2) Read about attaching this VM hard disk to second VM and loading the registry in second VM. But not sure how to do it.

Any suggestions.

You could use Azure Custom Script Extension to open port on Windows Firewall. Please refer to the following steps:

1.Start your VM.

2.Write a script to open port on Windows firewall. Like below:

netsh advfirewall firewall add rule name="Open Port 443" dir=in action=allow protocol=TCP localport=443

3.Execute this script by Custom Script Extension, you could do it on Azure Portal. Your VM --> Extensions --> + --> Custom Script Extension

在此处输入图片说明

Note: You also need open port 443 on Azure NSG. When you select Service, select Custom not https .

you may restore default port using "RUN COMMAND" option

follow the below steps:

  1. choose desired VM machine
  2. Click on " Run Command " from the left menu panel
  3. Choose " SetRDPPort " from the Command " Name " List
  4. Enter " Port Number " that you want to or 3389 for default
  5. Click on " Run " button
  6. It will take 2 minutes to finish and your RDP port will be changed and added to the VM firewall as well.
  7. Restart VM Machine
  8. Now you can access your machine via RDP

Furthermore, refer picture below for better understanding,

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM