UFW (Ubuntu / Debian)
1
Install UFW
2
Set default policies
3
Allow SSH BEFORE enabling
4
Allow additional services
5
Enable UFW
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Configure UFW or firewalld on your CrazyNode VPS to allow only trusted traffic.
Install UFW
apt install ufw -y
Set default policies
ufw default deny incoming
ufw default allow outgoing
Allow SSH BEFORE enabling
ufw allow 22/tcp
Allow additional services
ufw allow 80/tcp # HTTP
ufw allow 443/tcp # HTTPS
Enable UFW
ufw enable
ufw status verbose
ufw allow 3306/tcp # allow MySQL
ufw allow from 1.2.3.4 # allow all from one IP
ufw allow from 1.2.3.4 to any port 22 # allow SSH only from one IP
ufw delete allow 3306/tcp # remove a rule
ufw reload # reload rules
ufw disable # turn off (careful)
systemctl enable --now firewalld
firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
firewall-cmd --list-all
