I have Installed Nginx.
I have updated UFW firewall settings to allow https, I haven't allow ssh. Now I can't able to get into my virtual machine.
I want to remove the old firewall settings from Virtual Machine without doing ssh.
I have Installed Nginx.
I have updated UFW firewall settings to allow https, I haven't allow ssh. Now I can't able to get into my virtual machine.
I want to remove the old firewall settings from Virtual Machine without doing ssh.
Hi,
You can execute scripts on your Virtual Machine even if you cannot login to it, since the Azure add an agent in the VM by default. Using the script you can enable ssh, uninstall the ufw or do whatever you want.
Any script you execute from the portal (as the following explanation) is executed as root/administrator.
If you are using windows VM then:
Logon to the Azure portal-> select the VM -> on the left menu select Run command -> select RunPowerShellScript
If you this is Ubuntu VM then:
Logon to the Azure portal -> VM Name -> Extensions -> Add -> Select "Custom Script for Linux" > Create
Uncomplicated Firewall (UFW) uses a command-line interface which mean that using the above option you can run and control UFW using the script you execute even if you cannot login the VM
2 people are following this question.