Jan. 16, 2011, 4:21 a.m.
posted by whitehat
How to Add Users to Your Samba Domain
Adding users to a domain has three broad phases. The first is adding a Linux user on the Samba server, the second is creating a Samba smbpasswd that maps to the new Linux user, and the third is to map a Windows drive letter to the user's Linux home directory. Take a closer look.
Adding the Users in Linux
To create the user, use the command
[[email protected] tmp]# useradd -g 100 peter
Giving them a Linux password is necessary only if the user needs to log into the Samba server directly. If the user does, use this method:
[[email protected] tmp]# passwd peter Changing password for user peter. New password: Retype new password: passwd: all authentication tokens updated successfully. [[email protected] tmp]#
Mapping the Linux Users to an smbpassword
[[email protected] tmp]# /usr/bin/smbpasswd -a username password
The -a switch adds the user to the /etc/smbpasswd file. Use a generic password then have users change it immediately from their workstations in the usual way.
Remember the smbpasswd sets the Windows domain login password for a user, which is different from the Linux login password to log into the Samba box.
Mapping a Private Windows Drive Share
Mapping Using My Computer
If the auto-mapping doesn't work, then try:
If you're more a typist than a clicker, try the next method.
Mapping from the Command Line
If you find the My Computer method too time consuming for dozens of users or if the PC doesn't have the feature available, then you can use the command-line method and possibly make it into a script: