Differences between revisions 3 and 15 (spanning 12 versions)
Revision 3 as of 2020-01-15 05:12:17
Size: 1211
Comment:
Revision 15 as of 2023-04-08 13:25:45
Size: 1222
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= UFW = = Ufw =
Line 3: Line 3:
'''Uncomplicated Firewall''' ('''UFW''') is a simple-to-use but powerful firewall management software. It is a wrapper around '''iptables''', automatically writing rules for it. '''`ufw(8)`''' ('''U'''ncomplicated '''F'''ire'''w'''all) is a firewall management program. It is a wrapper around `iptables(8)`.

<<T
ableOfContents>>

----
Line 6: Line 10:
== Basic Setup ==
Line 8: Line 11:
This is more than sufficient for servers that are not meant to be web-facing. == Installation ==

Several [[Linux]] distributions offer a `ufw` package. Then [[Linux/Systemd|start and enable]] ufw.service.

----



== Configuration ==

A basic rule set is:
Line 13: Line 26:

ufw allow ssh
Line 18: Line 29:
If using custom ports, adjust as needed. This would be set in `/etc/ssh/sshd_config`. `ufw(8)` is distributed with '''app profiles''' that simplify the configuration process. Instead of allowing ''ports'', consider allowing ''apps''.

{{{
ufw allow ssh
}}}
Line 21: Line 36:
== HTTP ==
Line 23: Line 37:
Regardless of `httpd` flavor (Apache, NGINX, lighttpd, etc), this basic configuration should suffice. First the unencrypted port, then the encrypted port. === Web Servers ===

The following rules should allow any web server to operate.
Line 27: Line 43:
ufw allow 80
Line 29: Line 44:
ufw allow 443
Line 32: Line 46:
If using custom ports, adjust as needed. Additional steps may be required if using [[Encryption/Certbot|certbot]] on a custom port.
Line 35: Line 49:
== FTP ==
Line 37: Line 50:
First the unencrypted port, then the encrypted (FTPS, '''not''' SFTP) port. === FTP ===
Line 46: Line 59:
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 52: Line 65:
Recommended to use custom ports, so adjust as needed. ----



== See also ==

[[https://man.archlinux.org/man/ufw.8|ufw(8)]]

Ufw

ufw(8) (Uncomplicated Firewall) is a firewall management program. It is a wrapper around iptables(8).


Installation

Several Linux distributions offer a ufw package. Then start and enable ufw.service.


Configuration

A basic rule set is:

ufw default deny incoming
ufw default allow outgoing
ufw allow 22

ufw(8) is distributed with app profiles that simplify the configuration process. Instead of allowing ports, consider allowing apps.

ufw allow ssh

Web Servers

The following rules should allow any web server to operate.

ufw allow http
ufw allow https

Additional steps may be required if using certbot on a custom port.

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


See also

ufw(8)


CategoryRicottone

Ufw (last edited 2023-04-08 13:25:45 by DominicRicottone)