Close a port in ufw by deleting its rule
ufw close port | ufw delete allow rule | remove open port ufw | ufw | firewall | portCaution: This command changes the system. Understand what it does before you run it.
ufw delete allow 8080/tcpDeletes the rule exactly as it was created, for IPv4 and IPv6. The specification must match the original rule, with or without protocol, exactly as when it was created. If the default deny policy applies afterwards, the port is closed.
Note: Never delete the rule for the SSH port this way while you are connected through it and no other rule allows access.
Also searched as
- ufw close port
- ufw delete allow rule
- remove open port ufw