There are a few ways you can add a new entry to the
smbpasswd file:
-
You can use the
smbpasswd program with the
-a
option to automatically add any user that currently has a standard Unix system account on the server. This program resides in the
/usr/local/samba/bin directory.
-
You can use the
addtosmbpass executable inside the
/usr/local/samba/bin directory. This is actually a simple
awk script that parses a system password file and extracts the username and UID of each entry you wish to add to the SMB password file. It then adds default fields for the remainder of the user's entry, which can be updated using the
smbpasswd program later. In order to use this program, you will probably need to edit the first line of the file to correctly point to
awk on your system.
-
In the event that the neither of those options work for you, you can create a default entry by hand in the
smbpasswd file. The entry should be entirely on one line. Each field should be colon-separated and should look similar to the following:
dave:500:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:
This consists of the username and the UID as specified in the system password file, followed by two sets of exactly 32
X
characters, followed by the account flags and last change time as it appears above. After you've added this entry, you must use the
smbpasswd program to change the password for the user.