Courseiva
Security →easyMultiple Choice

XK0-006 Security Practice Question

A technician needs to ensure a service can listen on TCP port 8443 using firewalld. Which command permanently adds the port to the default zone?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

firewall-cmd --add-port=8443/tcp --permanent

The correct syntax is firewall-cmd --add-port=8443/tcp --permanent. The other options either omit the protocol, use incorrect syntax, or forget --permanent.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    firewall-cmd --add-port=8443/tcp --permanent

    Why this is correct

    The `--permanent` flag writes the rule to firewalld's persistent configuration rather than only the runtime set, satisfying the requirement to add the port permanently. Without it, the change would vanish on reload or reboot. The command targets the default zone automatically, so no `--zone` argument is needed.

  • ✗

    firewall-cmd --add-port=8443 --permanent

    Why it's wrong here

    Omitting /tcp leaves the protocol unspecified, and firewalld requires port entries in port/protocol form, so the command errors rather than adding the rule. It is tempting because --permanent is correctly present; the syntax is right for a port that already carries an explicit protocol suffix.

  • ✗

    firewall-cmd --add-port=8443/tcp

    Why it's wrong here

    Missing --permanent; the rule will not persist after reload.

  • ✗

    firewall-cmd --add-service=8443/tcp --permanent

    Why it's wrong here

    --add-service expects a named service definition from /usr/lib/firewalld/services, not a port/protocol pair, so 8443/tcp is rejected as an unknown service. It is tempting because --add-service is the right approach when a predefined service such as https already maps the required ports.

About these practice questions

This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.