Adding Users to Samba + LDAP

This is a short cheat sheet on adding users using smbldap tools. Later I’ll be posting a script for mass user adding.

First Find the GID of the Primary group that the user should belong in.

#smbldap-groupshow GroupName

Default Group Names to GID Mappings

  • Domain Admins — 512
  • Domain Users — 513
  • Domain Guests — 514
  • Administrators — 544
  • Account Operators — 548
  • Print Operators — 550
  • Backup Operators — 551
  • Replicators — 552

To add a new user run this command

#smbldap-useradd -amg 512 -A 1 username
#smbldap-passwd username

Type password twice

The -a switch tells this is a Windows User. The -m switch says to create the home directory for the user. The -g 512 tells that the group should be Domain Admins. The -A 1 says that the user can change their own password. If the user is to belong in multiple groups then it will have to be put in a primary group and then supplementary groups. This command will do that.

#smbldap-useradd -amg 512 -G “Domain Users”,”Administrators” -A 1 username

Make sure that if the group name is multiple words that is enclosed in ” “.
To edit a user that has already been added the command is

#smbldap-usermod -g 512 -G “Domain Users” username

Adding New Groups

To add a new group the command is

#smbldap-groupadd -a Group Name

2 Responses to "Adding Users to Samba + LDAP"

Leave a replyLeave a Reply to Stvaranje WordPress Tem od Nule