Заметки сисадмина » Ubuntu20: How to enable/disable firewall

Заметки сисадмина о интересных вещах из мира IT, инструкции и рецензии. Настраиваем Компьютеры/Сервера/1С/SIP-телефонию в Москве

Ubuntu20: How to enable/disable firewall

2023-10-31 · Posted in Ubuntu

The default Ubuntu firewall is ufw, which is an acronym for “uncomplicated firewall.” It comes automatically installed on all editions of Ubuntu Desktop and Ubuntu Server. Ufw is a frontend for the typical Linux iptables commands, but it is developed in such a way that basic firewall tasks can be performed without the knowledge of iptables. You may find you need to disable ufw if it is blocking some necessary connections, or you can enable it for increased security.

1)The first thing we should do is check the status of the firewall to see if it’s on or off.

As seen here, our firewall is currently active (on). For more detailed output regarding your current firewall settings, add the verbose option.

2)To disable the Ubuntu firewall, execute the following command.

3)If you decide you need to enable the Ubuntu firewall again later, you can run the following command.

Please note that by enabling your firewall you may get disconnected if you are currently using SSH to remotely connect to your Ubuntu server.

Enable or Disable Ubuntu firewall via GUI

To control ufw via GUI, you need to install the gufw package with the following command.

Then, start the gufw application and click on the Status switch to either enable or disable the firewall. See the video below for more help.

Leave a Reply