- Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- Installing Samba
- Getting a Simple Samba Setup Running
- Configuring Samba
- Configuring a Samba File Server with linuxconf
- Sharing Files and Print Services
- Optimizing Samba Performance
- Testing Your Configuration
- Running the Samba Server
- Accessing Shares
- Common smb.conf Options
- Samba Resources
- Using Samba as a Logon Server
- Samba Troubleshooting Tips
- Samba Security
- Using SWAT for Web-Based Samba Configuration
- Using Samba as a Linux Migration Tool
- Summary
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
- Chapter 28. Emulators, Tools, and Window Clients
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
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
Running the Samba Server | Next Section

Account Sign In
View your cart