- 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
Samba Troubleshooting Tips
A detailed description of the troubleshooting process used in Samba diagnosis is beyond the scope of this chapter. Suffice it to say that you diagnose Samba problems using a narrowing process similar to other troubleshooting tasks. This section gives a few handy tips for quick diagnosis of Samba problems.
Use testparm Early and Often
The testparm utility tests your smb.conf file for legal syntax, printing out errors and warnings for illegal syntaxes. The 15 seconds it takes is well worth the reduction in troubleshooting time. Many problems revealed by testparm are difficult to pinpoint with other tests.
Another great use for testparm is finding Samba's defaults. Start by creating an empty file called empty.fil. Then, to find the default for the preferred master= parameter, execute the following command:
$ testparm -s empty.fil | grep -i "preferred master"
preferred master = No
$
The preceding command reveals the default to be No.
Use DIAGNOSIS.txt
This is a predefined diagnostic written by Andrew Tridgell, the originator of Samba. Following the steps of this file yields a remarkably quick pinpointing of the cause of Samba problems. Better still, it provides a common symptom description tool for everyone, so a simple "it failed on step 7 of DIAGNOSIS.txt" replaces paragraphs of text. On your Red Hat 7 distribution, this file is available at /usr/share/doc/samba-2.0.7/ docs/textdocs/DIAGNOSIS.txt.
Understand the Access Hierarchy
Samba requires a functioning network, meaning you can't Samba if you can't ping. A "Samba problem" is not really a Samba problem if you can't ping—it's a network problem.
Likewise, you can't browse on a Windows client if you can't browse (via smbclient -NL servername) on the Linux server. So if Windows browsing doesn't work, check browsing on the server.
Additionally, you can't browse in Network Neighborhood if you can't browse in the Windows command environment via the net view \\servername command. The bottom line is to be conscious of the following access hierarchy:
- You must be able to ping to be able to browse on the server.
- You must be able to browse on the server to browse on the Windows client's command line.
- You must be able to browse on the Windows client's command line to be able to browse in Network Neighborhood or Windows Explorer.
Look at the Log Files
Samba writes its activity to its log files. The default location for its log files on a Samba server are contained in directory /var/log/samba. By viewing these logs you can look back in time to see what transpired during the error.
Additionally, most Samba software can be run at higher error levels such that more debugging information is written to the logs. This can greatly aid diagnosis. See the various man pages for methods of increasing error levels.
Use SWAT to Reduce Your smb.conf File
Comments are nice documentation, and so are parameters explicitly set to their default values. But too much of such "readability" makes for an incredibly unwieldy and therefore unreadable smb.conf. Sometimes it's nice to get rid of all the comments and the parameters set explicitly to their default values. SWAT does just that. Simply back up your existing smb.conf (this is a must), and then run SWAT as root, enter the global page, and click the Commit Changes button. All comments and explicitly specified defaults disappear, leaving just the system's distinctive features.
Making a Sure-Fire Browser smb.conf
Sometimes you just can't see the Samba server from your Windows 9x machines. This is especially prevalent when there is no WINS server, domain master, or PDC on the network. If there are no NT or Windows 2000 servers (or clients acting as WINS servers or PDCs), you can guarantee the Samba box becomes a WINS server and browse master by including the following:
os level=65 preferred master=yes domain master=yes
Also, make sure to set the netbios name= parameter to the hostname of the Samba server, and to set the workgroup= parameter to the workgroup of the client computers.
Keep a Cool Head
Troubleshooting is easy with the right attitude. Simply hunt down the root cause with a "just the facts" attitude. You can see a detailed description of troubleshooting and troubleshooting processes at http://www.troubleshooters.com/tuni.htm.
Samba Security | Next Section

Account Sign In
View your cart