LPIC-2 System Security Practice Question
An administrator wants to create a chroot environment for a potentially compromised service. The service needs to read /etc/resolv.conf and /etc/hosts, and run from a directory /chroot/service. Which of the following steps is essential to ensure the chroot environment is secure and functional?
⚠ Common exam trap
Watch out — candidates often assume copying binaries and configs is sufficient, overlooking the need for device nodes that are part of the filesystem but not present in a minimal chroot.
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
✓
Create /dev/null and /dev/random inside the chroot using mknod.
A chroot environment typically lacks device nodes, and many services require /dev/null and /dev/random for basic I/O operations and entropy. Without these, the service may fail to start or behave unpredictably. Creating them with mknod ensures the service can function securely within the jail.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set the chroot directory to be read-only.
Why it's wrong here
Read-only is a security precaution but not required for basic operation.
- ✗
Mount /proc within the chroot jail.
Why it's wrong here
While /proc may be needed, it is secondary to device nodes; but it is often mounted. The question asks 'essential', and device nodes are more fundamental.
- ✗
Copy only the service binaries and configuration files into the chroot.
Why it's wrong here
This may miss necessary device nodes and libraries, leading to failures.
- ✓
Create /dev/null and /dev/random inside the chroot using mknod.
Why this is correct
Device files are required for many system calls; without them, the service may crash or hang.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-2 question from scratch — 507 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 LPIC-2 practice question is part of Courseiva's free LPI 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 LPIC-2 exam.