Last active
August 29, 2015 14:05
-
-
Save Fleshgrinder/54c631c22f52a7f7bbb8 to your computer and use it in GitHub Desktop.
Install and configure UFW firewall on Debian for easy firewall management.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install ufw and its dependencies. | |
export DEBIAN_FRONTEND=noninteractive | |
aptitude install -q -y ufw | |
# SEE: https://serverfault.com/questions/416727 | |
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