Firewall [UFW]
A firewall monitors and controls all incoming and outgoing network traffic, and can be implemented in the hardware or software level. See All Open Ports All ports opened by a program, including those blocked by a firewall. sudo ss -tupln Software Firewall (UFW) # Enable the SSH port if it is being used sudo ufw limit 22/tcp # `limit` is used to prevent bruteforce # Set default connection settings sudo ufw default deny incoming sudo ufw default allow outgoing # Open ports for the services running sudo ufw allow 80/tcp # Web server 1 sudo ufw allow 443/tcp # Web server 2 # Check if UFW is running and is configurations sudo ufw status numbered # Delete an entry sudo ufw delete 2 # Number given by `status numbered` # Enable UFW sudo ufw enable Block Pings Blocking pings prevents hackers from quickly discovering the server. It is still possible to scan all ports on the server and eventually find any open one, but it adds another layer of security. ...