Courseiva
mediumMultiple ChoiceObjective-mapped

XK0-006 Practice Question: A Linux server runs a web application that…

A Linux server runs a web application that frequently runs out of file descriptors. Which configuration change would permanently increase the maximum number of open files for all users?

⚠ Common exam trap

Many candidates confuse the system-wide kernel parameter 'fs.file-max' (Option A) with the per-user PAM limits in limits.conf, assuming that raising the kernel value alone will resolve per-process file descriptor exhaustion.

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

Edit /etc/security/limits.conf and add 'soft nofile 65536' and 'hard nofile 65536'

Editing /etc/security/limits.conf with both 'soft nofile' and 'hard nofile' entries permanently raises the per-user limit on open file descriptors for all users (or specified users/groups) at login. The soft limit is the current working limit, while the hard limit is the maximum ceiling; setting both ensures the user can reach the desired value without needing to run ulimit with root privileges.

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 'fs.file-max = 65536' in /etc/sysctl.conf

    Why it's wrong here

    Sets system limit, not per-user.

  • Add 'session required pam_limits.so' to /etc/pam.d/login

    Why it's wrong here

    pam_limits.so is already included; this enables limits but doesn't set values.

  • Run 'ulimit -n 65536' in a startup script

    Why it's wrong here

    Only affects current shell session.

  • Edit /etc/security/limits.conf and add 'soft nofile 65536' and 'hard nofile 65536'

    Why this is correct

    Correct file and syntax.

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.