These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

UNIX02/SAMBA Control

Classnotes | UNIX02 | RecentChanges | Preferences

Testing smb.conf

Once you have configured your smb.conf file, you can test for "internal correctness" of smb.conf using the testparm command. On a typical SAMBA system, running such a command might produce:
 [root@eigen samba]# testparm 
 Load smb config files from /etc/samba/smb.conf
 Processing section "[homes]"
 Processing section "[netlogon]"
 Processing section "[pr]"
 Processing section "[main_office]"
 Processing section "[business]"
 Processing section "[lab]"
 Loaded services file OK.
 WARNING: You have some share names that are longer than 8 chars
 These may give errors while browsing or may not be accessible
 to some older clients
 .... (a listing of valid entries from smb.conf)

User maintenance in SAMBA

Users are handled internally by SAMBA. The command for adding new users to SAMBA is smbadduser. Running it with no options gives us its usage:
 [root@electron samba]# smbadduser 
 Written: Mike Zakharoff email:

   1) Updates /etc/samba/smbpasswd
   2) Updates /etc/samba/smbusers
   3) Executes smbpasswd for each new user

 smbadduser unixid:ntid unixid:ntid ...

 Example: smbadduser zak:zakharoffm johns:smithj

where unixid is the user id under UNIX, and ntid is the user id under NT (Windows). So, if we wanted to add a UNIX user 'fred' to SAMBA, and Fred's SMB user name was 'fredjarvis', the command we would use would be:

 smbadduser fred:fredjarvis

Typically, you will keep NT user names the same as their UNIX counterpart, which simplifies the smbadduser command greatly:

 smbadduser fred:fred

Note that, unlike UNIX's useradd, smbadduser allows you to add multiple users at a time for SAMBA.

To change a SAMBA users password, use smbpasswd. The general usage for smbpasswd is

 smbpasswd username

which will allow you to change the password for 'username'.

SAMBA Starting and Restarting

SAMBA can be started any number of ways. However, if you are running a standard Linux server, the best way is to simply start the service as listed in the init scripts. Under Red Hat 7.3 this file is located here:

To start (or restart) SAMBA, simply pass the option 'restart'

 [root@eigen samba]# /etc/init.d/smb restart

Once your server is running, you can cause SAMBA to reload its configuration file and restart by sending it the SIGHUP command (which we covered in process control). Simply find the process associated with smbd (the SMB Daemon):

 [root@electron samba]# ps aux | grep smbd
 root      1330  0.0  0.2  4884 1588 ?        S    08:55   0:00 smbd -D

and send a SIGHUP signal to it. There may be multiple instances of smbd running, thus, it generally advisable to send a SIGHUP to all of them. Recall that you can do this quite easily with the killall command:

 [root@electron samba]# killall -SIGHUP smbd

Classnotes | UNIX02 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited August 14, 2003 11:32 pm (diff)
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.