2022-12-24 17:42:40 +01:00
|
|
|
|
2022-12-24 17:09:22 +01:00
|
|
|
+++
|
2022-12-24 22:54:34 +01:00
|
|
|
date="2022-12-24"
|
2022-12-24 17:09:22 +01:00
|
|
|
author="spanskiduh"
|
|
|
|
title="ufw"
|
2022-12-24 17:42:40 +01:00
|
|
|
description="click to read about ufw"
|
2022-12-24 17:09:22 +01:00
|
|
|
+++
|
2022-12-24 22:54:34 +01:00
|
|
|
# UFW
|
2022-12-24 17:09:22 +01:00
|
|
|
|
|
|
|
### Connections
|
|
|
|
- `sudo ufw status numbered verbose` - check ufw status
|
|
|
|
- `sudo ufw default deny incoming` - deny incoming connections
|
|
|
|
- `sudo ufw default allow outgoing` - enable outgoing connections
|
|
|
|
- `sudo ufw allow ssh` - allow certian connection (you can also specify a port number instead of protocol!)
|
|
|
|
- `sudo ufw deny ssh` - deny certian connection
|
|
|
|
- `sudo ufw allow/deny proto tcp from any to any port 80,443` - deny / allow all 80 and 443 connections
|
|
|
|
- `sudo ufw allow from 192.168.1.103 to any port 22`- allow incomming ssh connections with specified ip.
|
|
|
|
- `sudo ufw allow from 192.168.1.1/24 to any port 22` - same thing, but now with specified subnet
|
|
|
|
- `sudo ufw delete <rule-id>` - delete rule from ufw, get id with status command
|