Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: VPS Setup

Reset UFW rules on Ubuntu for a clean slate—install with
apt install ufw
add rules like
ufw allow 22
then reset with
ufw reset
—answer \"y\" to clear all rules Rebuild with
ufw default deny incoming && ufw allow ssh
and enable with
ufw enable
Check with
ufw status
—expect only \"22/tcp ALLOW Anywhere\" Test SSH with
ssh user@ip
—expect success On Vultr this fixes misconfigured MySQL or FTP rules—log resets with
echo \"UFW reset $(date)\" >> /var/log/ufw-reset.log
ensuring uptime with a fresh firewall setup

Back to All Tips