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.
Question
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)- A71% (22)
- B3% (1)
- C6% (2)
- D19% (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.
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.
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.
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.
`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
Community Discussion
No community discussion yet for this question.