====== Resources ====== * https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands * https://linuxize.com/post/how-to-setup-a-firewall-with-ufw-on-ubuntu-20-04/ * https://wiki.archlinux.org/index.php/Uncomplicated_Firewall ====== Show Current Rules ====== * [[linux:distros:ubuntu|Ubuntu]] ===== List ===== **** sudo ufw status ===== Numbered ===== **** sudo ufw status numbered ====== Show Supported Apps ====== sudo ufw app list Test ====== Get App Info ====== * Change ''x'' to an app listed in above command sudo ufw app info x sudo ufw app info 'CUPS' ====== Limit Connections ====== * TODO: What does limit actually do? sudo ufw limit ssh ====== Allow Specific Port/Protocol ====== * ''22'' is the port number and ''tcp'' is the protocol * ''udp'' can be a protocol sudo ufw allow 22/tcp ====== Ubuntu Deny All and Allow SSH ====== **** sudo ufw reset && sudo ufw default deny && sudo ufw logging off && sudo ufw allow 'ssh' && sudo ufw limit 'ssh' && sudo ufw enable && sudo systemctl enable 'ufw'