nerdexam
Linux_Foundation

LFCS · Question #181

Which of the following correctly describes the method to add Samba users to the LDAP directory?

The correct answer is A. First make sure that a posixAccount entry exists in the Directory for the user you want to add, then. To add Samba users to an LDAP directory, a user's fundamental posixAccount entry must first exist in the directory before Samba-specific attributes can be associated with that user. Samba extends existing LDAP user accounts rather than creating them from scratch.

Submitted by stefanr· Apr 18, 2026User and Group Management

Question

Which of the following correctly describes the method to add Samba users to the LDAP directory?

Options

  • AFirst make sure that a posixAccount entry exists in the Directory for the user you want to add, then
  • BUse the smbpasswd -a command to add the Samba user from the command line. This will add all
  • CCreate an LDIF file containing all required information, then use ldapadd to add the information to
  • DCreate an LDIF file containing all required information, then use ldapmodd to add the Samba related

How the community answered

(31 responses)
  • A
    71% (22)
  • B
    3% (1)
  • C
    6% (2)
  • D
    19% (6)

Why each option

To add Samba users to an LDAP directory, a user's fundamental `posixAccount` entry must first exist in the directory before Samba-specific attributes can be associated with that user. Samba extends existing LDAP user accounts rather than creating them from scratch.

AFirst make sure that a posixAccount entry exists in the Directory for the user you want to add, thenCorrect

Samba integrates with existing user accounts in an LDAP directory by adding Samba-specific attributes to them, such as `sambaSamAccount`. Therefore, a basic user entry, typically a `posixAccount` which provides POSIX-like user information like UID and GID, must already be present in the directory before Samba attributes can be associated with that user for authentication and authorization.

BUse the smbpasswd -a command to add the Samba user from the command line. This will add all

The `smbpasswd -a` command is used to add or update Samba user passwords and attributes, but it assumes the core user account already exists in the LDAP backend; it does not create the initial `posixAccount` entry.

CCreate an LDIF file containing all required information, then use ldapadd to add the information to

While `ldapadd` is used to add entries from an LDIF file, simply creating an LDIF file and using `ldapadd` won't implicitly ensure the `posixAccount` entry exists or is handled correctly as a prerequisite for Samba integration.

DCreate an LDIF file containing all required information, then use ldapmodd to add the Samba related

`ldapmodd` is not a standard OpenLDAP command for adding entries; `ldapadd` is used for adding new entries and `ldapmodify` for modifying existing ones.

Concept tested: Samba-LDAP user account prerequisites

Source: https://wiki.samba.org/index.php/LDAP_Backend

Topics

#Samba#LDAP integration#User accounts#Directory services

Community Discussion

No community discussion yet for this question.

Full LFCS Practice