Courseiva
hardMultiple ChoiceObjective-mapped

XK0-006 Practice Question: A Linux system experiences high CPU usage from a…

A Linux system experiences high CPU usage from a process that appears to be a fork bomb. The administrator wants to prevent such attacks in the future by limiting the number of processes a user can create. Which configuration file should be modified, and what parameter should be set?

⚠ Common exam trap

CompTIA often tests the distinction between system-wide PID limits (kernel.pid_max) and per-user process limits (nproc), and candidates mistakenly choose A because they confuse maximum PID number with maximum number of processes.

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

Add 'username hard nproc 100' in /etc/security/limits.conf

/etc/security/limits.conf is the PAM-based configuration file used to set per-user resource limits via the 'nproc' parameter. Adding 'username hard nproc 100' enforces a hard limit of 100 processes for that user, preventing a fork bomb from exhausting system resources.

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 'kernel.pid_max=100' in /etc/sysctl.conf

    Why it's wrong here

    Limits total PIDs system-wide, not per user.

  • Set 'DefaultLimitNPROC=100' in /etc/systemd/system.conf

    Why it's wrong here

    This limits systemd services, not all user processes.

  • Add 'username hard nproc 100' in /etc/security/limits.conf

    Why this is correct

    Correctly limits the number of processes for a user via PAM.

  • Add 'ulimit -u 100' to /etc/profile

    Why it's wrong here

    ulimit in profile is not persistent for all sessions and can be bypassed.

About these practice questions

One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.