1. Install UFW: sudo apt install ufw

  2. Set default policies:

    • ufw default deny incoming

    • ufw default allow outgoing

  3. Allow SSH: ufw allow 22

  4. Enable UFW: ufw enable

  5. Check status: ufw status verbose

You can also allow specific ports like ufw allow 80 (HTTP) and ufw allow 443 (HTTPS).

Was this answer helpful? 0 Users Found This Useful (0 Votes)