aboutsummaryrefslogtreecommitdiff
path: root/content/blog/2021-01-07-ufw.md
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cleberg.net>2024-05-01 21:45:52 -0500
committerChristian Cleberg <hello@cleberg.net>2024-05-01 21:45:52 -0500
commitdc1261d703ae1e1a14841b030888e3f87ff7c38f (patch)
tree71139c9021b09704b2d45be3b64d54e2acbae55f /content/blog/2021-01-07-ufw.md
parentba6b552c8256cc2e071c910ef7821c82443f1f82 (diff)
downloadcleberg.net-dc1261d703ae1e1a14841b030888e3f87ff7c38f.tar.gz
cleberg.net-dc1261d703ae1e1a14841b030888e3f87ff7c38f.tar.bz2
cleberg.net-dc1261d703ae1e1a14841b030888e3f87ff7c38f.zip
prettier formatting and rewrap lines
Diffstat (limited to 'content/blog/2021-01-07-ufw.md')
-rw-r--r--content/blog/2021-01-07-ufw.md28
1 files changed, 14 insertions, 14 deletions
diff --git a/content/blog/2021-01-07-ufw.md b/content/blog/2021-01-07-ufw.md
index 803173c..b843fe8 100644
--- a/content/blog/2021-01-07-ufw.md
+++ b/content/blog/2021-01-07-ufw.md
@@ -9,8 +9,8 @@ draft = false
Uncomplicated Firewall, also known as ufw, is a convenient and beginner-friendly
way to enforce OS-level firewall rules. For those who are hosting servers or any
-device that is accessible to the world (i.e., by public IP or domain name),
-it's critical that a firewall is properly implemented and active.
+device that is accessible to the world (i.e., by public IP or domain name), it's
+critical that a firewall is properly implemented and active.
Ufw is available by default in all Ubuntu installations after 8.04 LTS. For
other distributions, you can look to install ufw or check if there are
@@ -57,9 +57,9 @@ sudo ufw default allow outgoing
# Adding Port Rules
-Now that we've disabled all incoming traffic by default, we need to open up
-some ports (or else no traffic would be able to come in). If you need to be able
-to `ssh` into the machine, you'll need to open up port 22.
+Now that we've disabled all incoming traffic by default, we need to open up some
+ports (or else no traffic would be able to come in). If you need to be able to
+`ssh` into the machine, you'll need to open up port 22.
```sh
sudo ufw allow 22
@@ -102,7 +102,7 @@ Now that the firewall is enabled, let's check and see what the rules look like.
sudo ufw status numbered
```
-``` txt
+```txt
Status: active
To Action From
@@ -114,8 +114,8 @@ Status: active
# Deleting Rules
If you need to delete a rule, you need to know the number associated with that
-rule. Let's delete the first rule in the table above. You'll be asked to
-confirm the deletion as part of this process.
+rule. Let's delete the first rule in the table above. You'll be asked to confirm
+the deletion as part of this process.
```sh
sudo ufw delete 1
@@ -134,7 +134,7 @@ sudo ufw app list
The results should look something like this:
-``` txt
+```txt
Available applications:
OpenSSH
Samba
@@ -152,7 +152,7 @@ sudo ufw app info plexmediaserver-dlna
You'll get a blurb of info back like this:
-``` txt
+```txt
Profile: plexmediaserver-dlna
Title: Plex Media Server (DLNA)
Description: The Plex Media Server (additional DLNA capability only)
@@ -182,7 +182,7 @@ make sure the content is properly formatted.
For example, here are the contents my `plexmediaserver` file, which creates
three distinct app rules for ufw:
-``` config
+```config
[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
@@ -199,14 +199,14 @@ description=The Plex Media Server (with additional DLNA capability)
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp|1900/udp|32469/tcp
```
-So, if I wanted to create a custom app rule called "mycustomrule," I'd create
-a file and add my content like this:
+So, if I wanted to create a custom app rule called "mycustomrule," I'd create a
+file and add my content like this:
```sh
sudo nano /etc/ufw/applications.d/mycustomrule
```
-``` config
+```config
[mycustomrule]
title=My Custom Rule
description=This is a temporary ufw app rule.