Courseiva
File Sharing and SambaeasyMultiple ChoiceObjective-mapped

LPIC-2 File Sharing and Samba Practice Question

After modifying /etc/samba/smb.conf, which command should be used to verify the syntax before restarting the Samba service?

⚠ Common exam trap

Test-takers frequently confuse `testparm` with diagnostic tools like `smbstatus` or `nmblookup`, assuming any Samba-related command can verify configuration, when only `testparm` is designed for that specific purpose.

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

testparm

The `testparm` command is specifically designed to parse and validate the syntax of the Samba configuration file `/etc/samba/smb.conf`. It checks for errors such as misspelled parameters, invalid values, or structural issues without requiring the Samba services to be running. This makes it the correct tool to verify syntax before restarting Samba.

Answer analysis

Option-by-option breakdown

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

  • nmblookup

    Why it's wrong here

    nmblookup is used for NetBIOS name resolution queries.

  • testparm

    Why this is correct

    testparm validates the smb.conf syntax and prints the effective configuration.

  • smbclient

    Why it's wrong here

    smbclient is an FTP-like client for accessing Samba shares.

  • smbstatus

    Why it's wrong here

    smbstatus displays current Samba connections.

About these practice questions

This LPIC-2 question is part of Courseiva's 507-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 by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-2 practice question is part of Courseiva's free LPI 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 LPIC-2 exam.