How to enable and disable a firewall on a VPS machine?
Ubuntu 20.04 servers on Digital Ocean can use any of the below servers.
- Digital Ocean Cloud Firewalls or
- UFW firewall
A firewall helps us configure what type of connections must be accepted and served, by configuring services available on a VPS machine.
Applications can register their services with UFW upon their installation, which can be turned off or on for external connections.
Commands to manage UFW firewall
Use the below Linux commands to manage the UFW firewall on a VPS machine.
Check the list of applications registered with UFW
# ufw app list
Allow a particular application listed to pass through the firewall
# ufw allow OpenSSH
Check the firewall status
# ufw status
Enable Firewall
# ufw enable
Disable Firewall
# ufw disable
Reference
https://www.digitalocean.com/community/initial-server-setup-with-ubuntu-20-04
Overall
Make sure to enable a firewall on a VPS machine, which can be a VPS on Hostinger, Droplet on Digital Ocean, or any similar VPS machine from Hosting providers.