sudo ufw status
on my Debian server initially showed the following configuration:
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
I've been able to successfully allow http connections via sudo ufw allow http
which yielded the following:
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
80 ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
80 ALLOW Anywhere (v6)
What is the command to reverse this? I've tried sudo ufw deny http
, but now sudo ufw status
is different than originally (it now explicitly lists that http is denied):
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
80 DENY Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
80 DENY Anywhere (v6)
Is this the same as my initial config, or is there a different command to revert sudo ufw allow http
?
From ufw's man page, it supports a "delete" command
delete RULE|NUM
deletes the corresponding RULE
They also give an example:
To delete a rule, simply prefix the original rule with delete with or without the rule comment. For example, if the original rule was:
ufw deny 80/tcp
Use this to delete it:
ufw delete deny 80/tcp
You may also specify the rule by NUM, as seen in the status numbered output. For example, if you want to delete rule number '3', use:
ufw delete 3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With