Courseiva
SecuritymediumMultiple ChoiceObjective-mapped

XK0-006 Security Practice Question

A system administrator wants to limit the number of simultaneous logins for a user to 2. Which file and parameter should be configured?

⚠ Common exam trap

The Linux+ exam often tests the distinction between `maxlogins` (simultaneous logins) and `nproc` (number of processes), and the difference between `soft` and `hard` limits, causing candidates to confuse process limits with login limits or choose a group-based entry when a per-user entry is required.

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

/etc/security/limits.conf: username hard maxlogins 2

The `/etc/security/limits.conf` file allows setting resource limits per user or group, and the `maxlogins` parameter specifically controls the maximum number of simultaneous logins for a user. The syntax `username hard maxlogins 2` enforces a hard limit of 2 concurrent sessions for that user, which is the exact requirement. This limit is enforced by the PAM module `pam_limits.so`, which must be configured in the appropriate PAM stack file (e.g., `/etc/pam.d/login` or `/etc/pam.d/sshd`).

Answer analysis

Option-by-option breakdown

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

  • /etc/pam.d/login: session required pam_limits.so

    Why it's wrong here

    This enables limits, but does not set the value.

  • /etc/security/limits.conf: username hard maxlogins 2

    Why this is correct

    Correct: limits.conf with hard maxlogins limits login count.

  • /etc/security/limits.conf: @users hard maxlogins 2

    Why it's wrong here

    @users applies to group, not specific user.

  • /etc/security/limits.conf: username soft nproc 2

    Why it's wrong here

    nproc limits processes, not logins.

Visual reference

Client Server SYN (seq=100) SYN-ACK (seq=200, ack=101) ACK (ack=201) Connection established — data transfer begins

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.