Skip to content

Instantly share code, notes, and snippets.

@Hotfirenet
Created February 20, 2017 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hotfirenet/acd59a8c31de631220afe42cb4025a19 to your computer and use it in GitHub Desktop.
Save Hotfirenet/acd59a8c31de631220afe42cb4025a19 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#Automation script By Hotfirenet to install ufw (firewall)
#NEED ROOT
#Use curl -sSL https://gist.githubusercontent.com/Hotfirenet/acd59a8c31de631220afe42cb4025a19/raw/05698e1a230783a9894b2df330296f91e9240d67/ufw-firewall.sh | bash
#installation
apt-get update
apt-get -y install ufw
#block input output
ufw default deny incoming
ufw default allow outgoing
#Allow SSH
ufw allow 22/tcp
#Allow 80 and 443
ufw allow "WWW Full"
#enable firewall
ufw enable
#need to reload ?
#ufw reload
#Todo ufw allow from myIP to any port 22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment