Forrest logo
back to the firewall-cmd tool

firewall-cmd:tldr:a43a5

firewall-cmd: Permanently open the port for a service in the specified zone (like port 443 when in the `public` zone).
$ firewall-cmd --permanent --zone=${public} --add-service=${https}
try on your machine

This command is used to configure a firewall rule to allow incoming HTTPS traffic in a specific zone permanently.

Let's break down the command:

  • firewall-cmd: This is the command-line tool used to manage the firewall configuration in a Linux system. It interacts with the firewalld service (which handles the firewall functionality).

  • --permanent: This option is used to make the changes persistent across system reboots. Without this option, the changes would be temporary and lost after a reboot.

  • --zone=${public}: It specifies the firewall zone for which the rule should be applied. In this case, ${public} suggests that the variable public represents the name of the zone. Different zones can have different rules and settings.

  • --add-service=${https}: This option adds a service-based rule to the firewall configuration. The variable ${https} indicates that the name of the service is stored in the variable https. In this case, the service https refers to the HTTPS protocol, which is used for secure web browsing.

The mentioned command, when executed, will add a permanent rule to the firewall of the specified zone, allowing incoming HTTPS traffic.

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