LPIC-2 File Sharing and Samba Practice Question
A new user needs access to a Samba share. The administrator adds the user to the system with `adduser alice` and then sets up a Samba password. Which command is used to set the Samba password?
⚠ Common exam trap
Candidates often confuse the Linux system password command (`passwd`) with the Samba-specific password command (`smbpasswd`), or mistakenly think `pdbedit` is the primary tool for setting a password interactively, when in fact `pdbedit` is more for managing the database entries and `smbpasswd` is the standard interactive tool for setting passwords.
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
✓
smbpasswd -a alice
The correct command is `smbpasswd -a alice`. This command adds a new user to the Samba password database and sets their initial Samba password. The `-a` flag specifically indicates that the user should be added to the local Samba user database (smbpasswd file or tdbsam), which is required before the user can authenticate to Samba 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.
- ✗
passwd -a alice
Why it's wrong here
passwd changes only the system password, not the Samba password.
- ✓
smbpasswd -a alice
Why this is correct
-a adds a new Samba user and prompts for a password.
- ✗
pdbedit -a -u alice
Why it's wrong here
pdbedit can also add users, but smbpasswd is more common for simple password setting.
- ✗
net ads user add alice
Why it's wrong here
This is for Active Directory user management, not local Samba users.
Go deeper
Related to this question
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 →
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.