Allow HTTPS permanently and apply it to the current runtime configuration.
Which command sequence is appropriate?
Add the service with --permanent, then reload so runtime state reads the permanent configuration.
Detailed explanation
firewall-cmd --permanent --add-service=https; firewall-cmd --reloadCorrect. It writes the permanent rule and then reloads runtime state.
Correct. It writes the permanent rule and then reloads runtime state.
firewall-cmd --remove-service=https; firewall-cmd --stateIncorrect. It removes HTTPS and only checks state.
Incorrect. It removes HTTPS and only checks state.
firewall-cmd --reload --add-service=httpsIncorrect. The options do not form a valid combined operation in that order.
Incorrect. The options do not form a valid combined operation in that order.
systemctl enable https.serviceIncorrect. systemd service enablement is separate from firewall permission.
Incorrect. systemd service enablement is separate from firewall permission.
Try it yourself
An example you can run in a temporary verification environment.
firewall-cmd --help 2>&1 | grep -E -- '--permanent|--add-service|--reload' | head -n 4Expected result
permanent、add-service、reloadの説明行Key points
- --permanent
- --add-service
- --reload
Notes
- Environment: firewalld firewall-cmd help / ルール変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.