Prerequisites
Before resetting UFW, make sure you have:
- SSH access to your VPS
- Root or sudo privileges
⚠️ Resetting will remove ALL firewall rules. You may lose SSH access!
Method 1: Disable and Reset
Connect to your VPS:
ssh hxroot@YOUR_SERVER_IP -p 22
sudo ufw disable
sudo ufw reset
Then re-enable with your desired rules.
Method 2: Reset and Keep SSH
sudo ufw reset
echo "y" | sudo ufw reset
sudo ufw allow ssh
sudo ufw enable
✅ UFW has been reset to default settings.