Skip to content

Instantly share code, notes, and snippets.

@nicekiwi
Created March 6, 2017 05:04
Show Gist options
  • Save nicekiwi/ba8562c5a3c0933e57439c33252de279 to your computer and use it in GitHub Desktop.
Save nicekiwi/ba8562c5a3c0933e57439c33252de279 to your computer and use it in GitHub Desktop.
#!/bin/bash
apt-get -y update
# install the firewall
echo 'Installing UFW'
apt-get install -y ufw
echo 'Configuring UFW'
# disable IPv6
# sed -i "s/IPV6=yes/IPV6=no/" /etc/default/ufw
# deny all incoming and outgoing connections
ufw default deny incoming
ufw default allow outgoing
# allow HTTP and HTTPS, and ssh
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow 2280/tcp
# allow SMTP, Submission and IMAPS
ufw allow smtp
ufw allow submission
ufw allow imaps
# enable ufw
ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment