CompTIA Linux+ (XK0-006)Services and User ManagementMedium

A system administrator wants to limit the number of concurrent login sessions for a specific user, `devuser`, to a maximum of 3. Which configuration file should be modified to achieve this?

  1. A/etc/security/limits.conf
  2. B/etc/profile
  3. C/etc/pam.d/login
  4. D/etc/login.defs
Show answer & explanation

Correct answer: A. /etc/security/limits.conf

The `/etc/security/limits.conf` file is used by the Pluggable Authentication Modules (PAM) `pam_limits.so` module to set resource limits for users, including the maximum number of concurrent login sessions.

Why the other options are wrong

  • B. This file is a system-wide initialization script for shell environments and doesn't manage login session limits.
  • C. This file configures PAM for the login service but doesn't directly set session limits; it would call `pam_limits.so` which uses `limits.conf`.
  • D. This file defines system-wide defaults for new users and password policies, not concurrent session limits.

pam_limits.so and limits.conf

The `pam_limits.so` PAM module uses the `/etc/security/limits.conf` file to enforce resource limits for users, such as CPU time, memory, or maximum concurrent login sessions.

  • Controls system resource usage for users.
  • Configured via `/etc/security/limits.conf`.
  • Part of Pluggable Authentication Modules (PAM).

Memory trick: PAM sets LIMITS on your resources.

More Services and User Management questions