There are two solutions to resolve this problem:
- cloud-init-per always fix_broken_ufw_1 sh -xc "/usr/sbin/service ufw stop >> /var/tmp/svc_$INSTANCE_ID 2>&1 || true"
- cloud-init-per always fix_broken_ufw_2 sh -xc "/usr/sbin/ufw disable>> /var/tmp/ufw_$INSTANCE_ID 2>&1 || true"
- Solution 1
- Stop your instance
- Go to User Data (Action > Instance Settings > View/Change User Data)
- Add following line then start instance again
- cloud-init-per always fix_broken_ufw_1 sh -xc "/usr/sbin/service ufw stop >> /var/tmp/svc_$INSTANCE_ID 2>&1 || true"
- cloud-init-per always fix_broken_ufw_2 sh -xc "/usr/sbin/ufw disable>> /var/tmp/ufw_$INSTANCE_ID 2>&1 || true"
- Solution 2
- Stop your instance
- Attach your EBS volume to another instance. if you don't have one, create a micro instance.
- Mount yor EBS volume somewhere ie. /opt/recover
- List item
- Edit {your-ebs-mount}/etc/ufw/ufw.conf and change enabled=yes to enabled=no
- Umount the EBS
- Detach from the temp instance
- Reattach to the original instance. (make sure to attach as root)
- Restart the instance