Add ufw commands

This commit is contained in:
James Skemp 2023-08-04 20:47:18 -05:00
parent 9be486087a
commit 69cb35ddd7
1 changed files with 17 additions and 0 deletions

View File

@ -285,3 +285,20 @@ scp -r .\path\to\directory\* <user>@<server>:/path/to/remove/directory
# Start a root shell. `exit` when done.
sudo -s
```
## Firewall (ufw)
```bash
# Show status of firewall. If active, also lists rules.
sudo ufw status
# Show rules even when ufw is inactive.
sudo ufw show added
# Allow by service.
sudo ufw allow ssh
# Allows 80 and 443.
sudo ufw allow 'Nginx Full'
# Allow port-number.
sudo ufw allow <port-number>
sudo ufw allow 8080
```