Courseiva
File Sharing and SambahardMultiple ChoiceObjective-mapped

LPIC-2 File Sharing and Samba Practice Question

Exhibit

Refer to the exhibit.

$ smbstatus -S
Service      pid     machine       Connected at
-------------------------------
data         1234    client1       Mon Jan 20 10:00:00 2025

$ pdbedit -L -v | grep -A5 "Unix username"
Unix username:        alice
NT username:          EXAMPLE\\alice
Account Flags:        [U          ]
User SID:             S-1-5-21-123456789-1001
Primary Group SID:    S-1-5-21-123456789-513
Full Name:            Alice
Home Directory:       \\server\\alice
Home Drive:           H:
Script Path:          \\server\\netlogon\\alice.bat
Profile Path:         \\server\\profiles\\alice

A user alice is connected to the 'data' share via smbd, but a file is locked. Which command can forcibly close the file?

⚠ Common exam trap

Many candidates confuse `smbcontrol` with other Samba utilities or think that restarting the entire Samba service (nmbd or smbd) is the only way to clear locks, overlooking the targeted `close-share` command.

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

smbcontrol smbd close-share data

`smbcontrol smbd close-share data` sends a message to the smbd process to forcibly close all open files on the 'data' share, releasing any locks held by users like alice. This command directly targets the Samba daemon's internal state without disrupting the entire service or other shares.

Answer analysis

Option-by-option breakdown

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

  • smbpasswd -L -e alice

    Why it's wrong here

    smbpasswd manages passwords, not locks.

  • smbcontrol smbd close-share data

    Why this is correct

    smbcontrol can interact with smbd to close a share.

  • systemctl restart nmbd

    Why it's wrong here

    nmbd is for NetBIOS, not file locks.

  • kill -9 $(pgrep smbd)

    Why it's wrong here

    Kills all smbd processes, disruptive.

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.