0

Yes, you can delete UFW rules by their number after listing them with “sudo ufw status numbered". Here’s how you can do it:
Step 1: List Current UFW Rules with Numbers

  1. List UFW Rules
#  sudo ufw status numbered

This command will list all the current UFW rules with numbers, making it easier to delete specific rules.
Step 2: Delete Specific UFW Rules by Number

  1. Identify the Rule Number Look at the output from the previous command and identify the number associated with the rule you want to delete. For example, if the rule for port 8444 (IPv4) is listed as [ 1], you would use that number to delete it.
  2. Delete the Rule by Number
#   sudo ufw delete [number]

Replace [number] with the actual number of the rule you want to delete. For example:

#   sudo ufw delete 1

Example
If the rule for port 8444 (IPv4) is listed as [ 1], you would run:

# sudo ufw delete 1

Step 3: Verify UFW Rules

  1. List UFW Rules Again
#   sudo ufw status

This command will list the current UFW rules to verify that the specified rules have been removed.

By following these steps, you can delete UFW rules by their number. If you encounter any issues or need further assistance, feel free to ask!

Spread the word:
Tech Junction Edited question 5 hours ago