Skip to main content

How to Disable/Remove Firewalld/UFW on Ubuntu 16.04 LTS ?

There are many Open Source Hosting Control Panel comes with predefined firewall. VestaCP uses Iptables+Fail2ban. But sometimes the UFW firewall is the default firewall that ships standard with the Ubuntu Linux Distribution. UFW stands for Uncomplicated Firewall. We are removing ufw because we will use CSF (ConfigServer Security & Firewall :- requires correct iptables configuration on host server) , So We will not remove default IPtables .
To enable the ufw firewall, open a new Terminal window and execute the following command:
# sudo ufw enable
To disable the ufw firewall, open a new Terminal windows and execute the following command:
# sudo ufw disable
To view the status of the ufw execute the below command:
# sudo ufw status
To remove UFW completely
# sudo apt remove --auto-remove ufw
# sudo apt purge ufw
# sudo apt purge --auto-remove ufw
# sudo apt remove ufw 

How to remove firewalld from Ubuntu 16.04 (Xenial Xerus)?
Uninstall firewalld
To remove just firewalld package itself from Ubuntu 16.04 (Xenial Xerus) execute on terminal:
# sudo apt remove firewalld
Uninstall firewalld and it's dependent packages
To remove the firewalld package and any other dependant package which are no longer needed from Ubuntu Xenial.
# sudo apt remove --auto-remove firewalld
Purging firewalld
If you also want to delete configuration and/or data files of firewalld from Ubuntu Xenial then this will work:
# sudo apt purge firewalld
To delete configuration and/or data files of firewalld and it's dependencies from Ubuntu Xenial then execute:
# sudo apt purge --auto-remove firewalld

Many Cloud provider provided custom OS with predefined firewall . So If you also want to remove fail2ban, Just follow firewalld section.

The article is based on: Link

Comments