Skip to content

Instantly share code, notes, and snippets.

View arnaudrenaud's full-sized avatar

Arnaud Renaud arnaudrenaud

View GitHub Profile
@arnaudrenaud
arnaudrenaud / set-up-ufw-firewall-linux-web-server.md
Last active April 20, 2024 12:41
Cheatsheet: Set up UFW firewall on a Linux web server

Set up UFW firewall on a Linux web server

For reference: https://www.webservertalk.com/ubuntu-firewall-how-to-configure-ufw/.

Run the following:

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22 # ⚠️ Replace by your actual SSH port (22 by default) — otherwise, SSH access will be lost after reboot!