Forrest logo
back to the firewall-cmd tool

firewall-cmd:tldr:61a69

firewall-cmd: Permanently close the port for a service in the specified zone (like port 80 when in the `public` zone).
$ firewall-cmd --permanent --zone=${public} --remove-service=${http}
try on your machine

The command "firewall-cmd --permanent --zone=${public} --remove-service=${http}" is used to remove a service from the firewall configuration permanently.

Here is the breakdown of the command:

  • "firewall-cmd" is a command-line tool used to manage the firewall configuration in a Linux system.
  • "--permanent" flag ensures that the changes made to the firewall configuration are permanent and will persist across reboots.
  • "--zone=${public}" flag specifies the firewall zone where the service will be removed. The value "${public}" is a variable that should contain the name of the zone (e.g., "public").
  • "--remove-service=${http}" flag specifies the service to be removed from the firewall configuration. The value "${http}" is a variable that should contain the name of the service (e.g., "http").

Overall, this command will remove the specified service (e.g., "http") from the firewall configuration in the specified zone (e.g., "public") permanently.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the firewall-cmd tool