Türkiye · France · Northern Cyprus05372609483
Network Security

Ubuntu UFW Firewall Setup and Basic Rules

  • 315 views
On This Page
  1. Basic setup
  2. Restrict management access
  3. Maintain rules
Network Security Markdown

UFW is Ubuntu's user-friendly interface for host firewall rules. Allow SSH before enabling it on a remote server.

Basic setup

sudo ufw allow OpenSSH\nsudo ufw allow 80/tcp\nsudo ufw allow 443/tcp\nsudo ufw enable\nsudo ufw status numbered

Restrict management access

When you have a stable management IP, limit SSH to that address. Keep the current session open while testing.

Maintain rules

Review numbered rules, remove obsolete entries and enable logging when needed. A firewall complements updates, strong authentication and monitoring.

Was this helpful?

Thanks for your feedback!