mediumMultiple Choice
XK0-006 Practice Question: A user is able to ping the Linux server but…
A user is able to ping the Linux server but cannot connect via SSH. The SSH service is running and listening. Which configuration file should the administrator review FIRST?
⚠ Common exam trap
The trap here is that candidates often jump to `/etc/hosts.allow` or PAM files because they associate 'cannot connect' with access control or authentication, but the question specifies the service is running and listening, which narrows the issue to SSH-specific configuration in `sshd_config`.
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/ssh/sshd_config
The SSH service is running and listening, but the user cannot connect. This points to a configuration issue within the SSH daemon itself. The `/etc/ssh/sshd_config` file controls SSH server settings such as allowed authentication methods, port numbers, and user access restrictions (e.g., `AllowUsers`, `DenyUsers`, `PermitRootLogin`). Reviewing this file first is the logical step to identify why connections are being rejected despite the service being active.
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
Why it's wrong here
PAM governs authentication and session modules for local logins, so it cannot block an already-listening SSH daemon. It is tempting because PAM failures do cause login denials, but that would be correct for local console or su authentication; here the SSH daemon's own configuration, sshd_config, controls access first.
- ✓
/etc/ssh/sshd_config
Why this is correct
/etc/ssh/sshd_config governs the daemon's listening behaviour, authentication methods and access controls, so it is the first place to check when SSH refuses connections despite the service running. Since ping succeeds, the network path is fine; the block likely lies in directives such as AllowUsers, PermitRootLogin or ListenAddress.
- ✗
/etc/nsswitch.conf
Why it's wrong here
Name resolution order is irrelevant here: the user already reaches the host by IP, so DNS or NSS lookups are not blocking the connection. It is tempting because nsswitch.conf governs how hostnames resolve, and it would be the right file to inspect if the failure were name resolution rather than TCP port 22 access.
- ✗
/etc/hosts.allow
Why it's wrong here
TCP wrappers are consulted by sshd, so hosts.allow can deny the client even while the daemon listens; however, modern OpenSSH builds often omit libwrap support, making this a plausible but unverifiable first check. It would be correct where TCP wrappers are compiled in and a deny rule blocks the source address.
Go deeper
Related to this question
Learn chapter
File Permissions and Ownership
Key term
Linux
Linux is an open-source operating system that manages computer hardware and software, widely used in servers, desktops, and embedded systems.
Key term
SSH
SSH (Secure Shell) is a cryptographic network protocol that provides secure, encrypted communication and remote administration between two devices over an unsecured network.
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 →
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.