Uncomplicate Firewall (ufw) Rules for LAMP in Ubuntu Server

-- 0. Check status
$ sudo ufw status 
Status: inactive

-- 1. Enable typical ports for SSH, HTTP(S)
$ sudo ufw allow ssh
$ sudo ufw allow http
$ sudo ufw allow https
$ sudo ufw allow mysql

-- 2. Enable the firewall
$ sudo ufw enable

-- 3. Don't like it, reset to default
$ sudo ufw reset ~
Resetting all rules to installed defaults. Proceed with operation (y|n)? y
Backing up 'user.rules' to '/lib/ufw/user.rules.20111029_214156'
Backing up 'after6.rules' to '/etc/ufw/after6.rules.20111029_214156'
Backing up 'user6.rules' to '/lib/ufw/user6.rules.20111029_214156'
Backing up 'before6.rules' to '/etc/ufw/before6.rules.20111029_214156'
Backing up 'after.rules' to '/etc/ufw/after.rules.20111029_214156'
Backing up 'before.rules' to '/etc/ufw/before.rules.20111029_214156'

No comments:

Post a Comment