Courseiva

XK0-006 Services and User Management Practice Question

A user reports that they cannot log in to a Linux server via SSH. The administrator checks /etc/passwd and sees the user's shell is set to /sbin/nologin. What is the most likely reason for the login failure?

⚠ Common exam trap

The trap here is assuming that a login failure is always due to password or account lock issues, overlooking the shell setting that explicitly denies interactive access.

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

✓

The user is not allowed to have an interactive shell.

The shell /sbin/nologin is designed to prevent interactive logins. When a user with this shell attempts to log in via SSH, the shell is executed and immediately exits, denying access. This is the most likely reason for the failure, as it directly matches the observed configuration.

Answer analysis

Option-by-option breakdown

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

  • ✗

    The SSH service is not running.

    Why it's wrong here

    If SSH were not running, the user would not be able to connect at all, and the administrator would not see a shell setting. The problem is specific to this user, as indicated by the shell. Other users can likely log in, so SSH is running.

  • ✓

    The user is not allowed to have an interactive shell.

    Why this is correct

    /sbin/nologin is a shell that prints a message and exits immediately, denying interactive login. It is commonly set for system accounts or users who should only use services like FTP or email. The SSH login fails because the shell does not provide an interactive session.

  • ✗

    The user's account is locked.

    Why it's wrong here

    A locked account usually shows a '!' or '*' in /etc/shadow, not a shell of /sbin/nologin. While a locked account also prevents login, the specific shell setting is a separate mechanism. The scenario points to the shell, which is a deliberate configuration to deny shell access.

  • ✗

    The user's password has expired.

    Why it's wrong here

    An expired password would typically prompt the user to change it at login, not prevent login entirely. The shell being /sbin/nologin indicates the account is intentionally restricted from interactive login, regardless of password status. Password expiry is not the cause here.

About these practice questions

This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

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.