Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@snoopdouglas
Last active July 22, 2016 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snoopdouglas/acf62700071ed125ac7102c623170e13 to your computer and use it in GitHub Desktop.
Save snoopdouglas/acf62700071ed125ac7102c623170e13 to your computer and use it in GitHub Desktop.
One-liner to delete all ufw rules without disabling or reloading the firewall
for j in $(for i in $(sudo ufw status numbered | (grep -E '[0-9]+/(tc|ud)p' |awk -F"[][]" '{print $2}') ) ; do echo $i ; done | tac) ; do sudo ufw --force delete $j ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment