How to Configure a Firewall

A firewall controls incoming and outgoing network traffic. This article covers basic firewall configuration using UFW on Ubuntu/Debian and firewalld on CentOS/RHEL.

Using UFW (Ubuntu/Debian)

Enable UFW:

sudo ufw enable

Allow SSH:

sudo ufw allow 22/tcp

Allow HTTP and HTTPS:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Check status:

sudo ufw status

Using firewalld (CentOS/RHEL)

Enable firewalld:

sudo systemctl enable firewalld
sudo systemctl start firewalld

Allow SSH:

sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload

Need Help?

If you accidentally lock yourself out, contact us through the Circle City Servers Support Portal.

  • firewall, ufw, iptables
  • 0 Kasutajad peavad seda kasulikuks
Kas see vastus oli kasulik?

Seotud artiklid

How to Use SSH Keys for Secure Login

SSH keys provide a more secure way to log into your server than passwords alone. This article...

How to Change Your SSH Port

Changing the default SSH port from 22 to a custom port can help reduce automated login attempts....

How to Create and Restore Backups

Regular backups protect your data from accidental deletion, hardware failure, or security...

Best Practices for Securing Your Server

Keeping your server secure is a shared responsibility. Follow these best practices to protect...

How to Install and Configure Fail2Ban

Fail2Ban monitors log files and bans IP addresses that show malicious signs, such as repeated...