Secure your CentOS 9 server with FirewallD configuration and best practices.
Secure your CentOS 9 server by implementing FirewallD. This guide covers essential security measures to protect your VPS.
FirewallD is the default firewall management tool for RHEL-based systems, providing dynamic firewall management with D-Bus interface.
sudo dnf install firewalld -y
Set up basic firewall rules:
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo firewall-cmd --state
sudo firewall-cmd --list-all
Your CentOS server is now protected with FirewallD. Regular security audits are recommended.