300-300 practice question 7 of 15

Which of the following statements are true regarding the smbpasswd command? (Choose two.)

Full set: 53 questions
Answer options
A: The -x parameter removes an account from the Samba database. Correct answer
B: The -a parameter adds an account to the Samba database. If the account already exists, this parameter is ignored. Correct answer
C: The -d parameter deletes an account from the Samba database.
D: The -e parameter excludes an account from the Samba database.
E: smbpasswd changes only passwords on Samba domain controllers while DCs running Windows keep the old passwords.
Correct Answer:
A. The -x parameter removes an account from the Samba database.; B. The -a parameter adds an account to the Samba database. If the account already exists, this parameter is ignored.
Explanation

The smbpasswd command is a utility for managing users within Samba's password database. Option A is correct as the -x parameter is explicitly used to delete a user from the Samba database. Option B is also correct in its primary assertion that the -a parameter adds a user to the Samba database. For this operation to succeed, the user must already exist as a system account (e.g., in /etc/passwd). While the command fails if the user already exists in the Samba database rather than being "ignored," this option most accurately describes the fundamental purpose of the -a flag compared to the other incorrect choices.

Why Incorrect

C. The -d parameter is used to disable a Samba account, preventing the user from logging in, but it does not delete the account.
D. The -e parameter is used to enable a previously disabled Samba account; it does not exclude it from the database.
E. This statement describes a potential password synchronization behavior in a specific network topology, which is a matter of domain configuration and replication, not a direct function of the smbpasswd command itself.

References

1. Samba Official Documentation (Man Page): The smbpasswd(8) man page is the authoritative source for the command's options.

-a: "This option specifies that the username following should be added to the local smbpasswd file... If the user already exists in the smbpasswd file this command will fail and return an error."

-x: "This option specifies that the username following should be deleted from the local smbpasswd file."

-d: "This option specifies that the username following should be disabled in the local smbpasswd file."

-e: "This option specifies that the username following should be enabled in the local smbpasswd file."

(Reference available via man smbpasswd on a system with Samba installed or online man page repositories).

2. The Official Samba-3 HOWTO and Reference Guide, 2nd Edition:

Chapter 10. User and Group Account Management, Section 10.3. User Account Management: This chapter details the use of smbpasswd. It states, "To add a user to the Samba password database... smbpasswd -a " and "To delete a user from the Samba password database... smbpasswd -x ". This confirms the functions of -a and -x.

3. University of Washington, CSE 461: Introduction to Computer-Communication Networks, Samba Lab:

Course materials on setting up Samba servers frequently cover user management. Lab instructions often specify using smbpasswd -a to add users and smbpasswd -x to remove them, reinforcing the functions described in options A and B. For example, in the section on "Adding Samba Users," the procedure is outlined as: "First, create a normal Linux user... Second, add the user to the Samba password file: smbpasswd -a ".

Scroll to Top