How to deny all incoming ports except FTP port 20 and 21 on Ubuntu 18.04 Bionic Beaver Linux - LinuxConfig.org


#1

The objective is to enable UFW firewall, deny all incoming ports however only allow FTP port 20 and 21 on Ubuntu 18.04 Bionic Beaver Linux. Check your firewall status. By default the UFW firewall will be disabled.

$ sudo ufw status
Status: inactive Keep the firewall disabled to allow possible SSH connections or enable it by:
$ sudo ufw enable

This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-deny-all-incoming-ports-except-ftp-port-20-and-21-on-ubuntu-18-04-bionic-beaver-linux