#ufw
10 one-liners with this tag.
All one-liners tagged ufw
Allow a port only from a specific IP with ufw
#ufw allow from 198.51.100.0/24 to any port 22 proto tcp
Block an IP address or subnet with ufw
#ufw insert 1 deny from 203.0.113.0/24
Close a port in ufw by deleting its rule
#ufw delete allow 8080/tcp
Count IP addresses blocked by ufw
#journalctl -k --since "today" --no-pager | grep 'UFW BLOCK' | grep -o 'SRC=[^ ]*' | sort | uniq -c | sort -rn | head -20
Delete a ufw rule by number
#ufw delete 3
Enable ufw logging
#ufw logging low
Enable ufw without locking yourself out
#ufw allow 22/tcp && ufw enable
List ufw rules with numbers
#ufw status numbered
Open a port with ufw
#ufw allow 443/tcp
Show detailed ufw status and default policies
#ufw status verbose