Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Testing Your Configuration

After creating the configuration file, you should test it for correctness. Start by making sure the client and server can ping each other's IP address. Without a functioning network, Samba will not work.

Next, use the testparm program. testparm is a simple test program that checks the /etc/samba/smb.conf configuration file for internal correctness. If this program reports no problems, you can use the configuration file with confidence that smbd will successfully load the configuration file.

testparm has the following command line:

testparm [configfile [hostname hostip]]

configfile indicates the location of the smb.conf file if it is not in the default location (/etc/samba/smb.conf). The hostname hostip optional parameter instructs testparm to see whether the host has access to the services provided in the smb.conf file. If you specify hostname, you must specify the IP number of that host as well. Otherwise, the results will be unpredictable.

The following illustrates sample output from running testparm. If there are any errors, the program reports them, along with a specific error message:


   # testparm smb.conf ntackett 209.42.203.236
Load smb config files from smb.conf
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
Allow connection from ntackett (209.42.203.236) to homes
Allow connection from ntackett (209.42.203.236) to printers
Allow connection from ntackett (209.42.203.236) to lp

Testing with smbstatus

The smbstatus program reports on current Samba connections. smbstatus has the following command line:


   # smbstatus [-d] [-p] [-s configfile]

configfile is by default /etc/samba/smb.conf. -d provides verbose output, and -p provides a list of current SMB processes. The -p option is useful if you are writing shell scripts using smbstatus. Following is sample output:


   # smbstatus

Samba version 2.0.7
Service      uid      gid      pid     machine
----------------------------------------------
spec_dir     myuid    myuid     4381   p2300    (192.168.100.201)
   Thu May  6 22: 18:31 1999

No locked files

Share mode memory usage (bytes):
   1048464(99%) free + 56(0%) used + 56(0%) overhead = 1048576(100%) total

Share ThisShare This

Informit Network