Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Install and configure UFW firewall on Debian for easy firewall management.
# Install ufw and its dependencies.
export DEBIAN_FRONTEND=noninteractive
aptitude install -q -y ufw
# SEE:
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Configure ufw to allow SSH, HTTP and HTTPS and enable it.
ufw default deny
ufw limit 22
ufw allow 80
ufw allow 443
ufw enable
# Use numbered output for deleting!
ufw status numbered
# ufw delete X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment