easyMultiple SelectObjective-mapped
XK0-006 Practice Question: A user cannot log in to a Linux system via SSH,…
A user cannot log in to a Linux system via SSH, but the SSH service is running and network connectivity is fine. Which TWO commands should the administrator use to troubleshoot the issue? (Choose TWO.)
⚠ Common exam trap
Many candidates choose `ss -tlnp | grep :22` (Option D) because they think verifying the port is listening is the first step, but the question explicitly states the service is running and network is fine, making this command redundant and not a troubleshooting step for the user-specific login failure.
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
✓
journalctl -u sshd -n 20
`journalctl -u sshd -n 20` displays the last 20 log entries for the SSH daemon (sshd). This allows the administrator to see authentication failures, configuration errors, or other SSH-specific issues that prevent login, even when the service is running and network connectivity is fine.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
journalctl -u sshd -n 20
Why this is correct
View recent SSH daemon logs for authentication errors.
- ✗
cat /etc/ssh/sshd_config
Why it's wrong here
Checking config is useful but not the first two steps; logs and basic user info are quicker.
- ✗
passwd -S username
Why it's wrong here
Shows account status (locked/unlocked), but that is a possible cause, but less common than shell issues and logs.
- ✗
ss -tlnp | grep :22
Why it's wrong here
Confirms SSH is listening, but already known to be running.
- ✓
grep '^username:' /etc/passwd
Why this is correct
Check if the user has a valid shell set in /etc/passwd.
Go deeper
Related to this question
Learn chapter
Linux Fundamentals and History
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.
Key term
Service
A service is a software component or system that performs a specific function and is available to be used by other programs or users over a network.
About these practice questions
Courseiva writes every XK0-006 question from scratch — 979 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.