Size: 1491
Comment:
|
Size: 849
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## page was renamed from UFWSetup | |
Line 6: | Line 5: |
UFW is accessed through the `ufw` executable, which on many distributions is installed to `/usr/sbin`--only the root user will have this program on their path. The associated `systemd` service file is `ufw.service`. | <<TableOfContents>> |
Line 12: | Line 11: |
== Basic Setup == | == Installation == |
Line 14: | Line 13: |
This is more than sufficient for servers that are not meant to be web-facing. | ---- == Configuration == A basic rule set is: |
Line 24: | Line 29: |
If using custom ports, adjust as needed. This would be set in `/etc/ssh/sshd_config`. ---- |
|
Line 29: | Line 31: |
=== Web Servers === | |
Line 30: | Line 33: |
== HTTP == Regardless of `httpd` flavor (Apache, NGINX, lighttpd, etc), this basic configuration should suffice. First the unencrypted port, then the encrypted port. |
The following rules should allow any web server to operate. |
Line 41: | Line 42: |
If using custom ports, adjust as needed. ---- |
|
Line 46: | Line 44: |
== FTP == First the unencrypted port, then the encrypted (FTPS, '''not''' SFTP) port. |
=== FTP === |
Line 58: | Line 53: |
Passive configuration also utilizes a pool of ports. This is an example--'''''not''''' recommended--configuration for `vsftpd`. | Passive configuration also utilizes a pool of ports. Recommended to use custom ports, so adjust as needed. |
Line 64: | Line 59: |
Recommended to use custom ports, so adjust as needed. |
UFW
Uncomplicated Firewall (UFW) is a simple-to-use but powerful firewall management software. It is a wrapper around iptables, automatically writing rules for it.
Contents
Installation
Configuration
A basic rule set is:
ufw default deny incoming ufw default allow outgoing ufw allow ssh ufw allow 22
Web Servers
The following rules should allow any web server to operate.
ufw allow http ufw allow 80 ufw allow https ufw allow 443
FTP
ufw allow 20/tcp ufw allow 21/tcp ufw allow 989/tcp ufw allow 990/tcp
Passive configuration also utilizes a pool of ports. Recommended to use custom ports, so adjust as needed.
ufw allow 40000:42000/tcp