Change UFW config or disable Firewall on your server mount Raid

Sometimes it can happen that you have not configured your firewall correctly and locked yourself out so that the server is no longer accessible. Activate rescue CD and restart server with Linux 64 bit.


mkdir /media/mydrive

mount /dev/md2 /media/mydrive

ls /media/mydrive

Now you can access config files in your main operating system.
UFW configs you can find in Ubuntu

vim /etc/ufw/user.rules

So you can reach it in this way.

vim /media/mydrive/etc/ufw/user.rules

Then you can add rules with your own IP and restart the server…
Or you can disable UFW with

vim /media/mydrive/etc/ufw/ufw.conf