XK0-006 Security Practice Question
A Linux technician is configuring a firewall with firewalld. The organization requires that SSH services be available only on the internal network zone (10.0.0.0/8). Which command should be used to add this rule permanently?
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 --zone=internal --add-service=ssh --add-source=10.0.0.0/8 --permanent
Option D is correct because it uses --add-service=ssh to allow the SSH service and --add-source to restrict the source to 10.0.0.0/8, making the rule permanent. This follows best practices by leveraging service definitions. Option A opens port 22 directly, which works but is less precise and not service-aware. Option C uses a rich rule, which is overly complex for this straightforward requirement. Option B targets the public zone, which is incorrect.
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 --zone=internal --add-port=22/tcp --add-source=10.0.0.0/8 --permanent
Why it's wrong here
Adding port directly bypasses service definition and is less maintainable.
- ✗
firewall-cmd --zone=public --add-service=ssh --add-source=10.0.0.0/8 --permanent
Why it's wrong here
The public zone is not the intended zone for internal network.
- ✗
firewall-cmd --zone=internal --add-rich-rule='rule family=ipv4 source address=10.0.0.0/8 service name=ssh accept' --permanent
Why it's wrong here
This also works but is more verbose. However, the simpler command is sufficient.
- ✓
firewall-cmd --zone=internal --add-service=ssh --add-source=10.0.0.0/8 --permanent
Why this is correct
This adds both source and service to the zone, making SSH available only from internal network.
Go deeper
Related to this question
Learn chapter
Linux Fundamentals and History
Key term
Service
A service is a software component or system that performs a specific function and is available to be used by other programs or users over a network.
Key term
firewalld
firewalld is a dynamic firewall management tool for Linux systems that controls incoming and outgoing network traffic using zones and rules.
About these practice questions
Courseiva writes every XK0-006 question from scratch — 979 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.