Troubleshooters.Com's Linux Library Presents

Troubleshooting Samba
Presented to LEAP-CF 9/16/1999
by Steve Litt

Copyright (C) 1999 by Steve Litt, you can freely distribute unmodified copies if this copyright notice and disclaimer are intact. 
This presentation has no warrantee, express or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the presentation is with you.

Samba is a File (and print) Server

Samba is Never a Black Box

The Simplest Possible smb.conf

encrypt passwords=yes
netbios name=servername

Card Trick

Quick Split: Karate Kid Samba Troubleshooting

Troubleshooting Tactics Specially Suited to Samba


Included with the Samba distribution, this is a predefined diagnostic created by Andrew Tridgell. Ideal quick section, and accepted form of Samba diagnostic information transfer.

Troubleshooting Samba Printer Problems

Printing hint: Always make sure your printing= global option is set correctly. Option BSD works quite well in Linux.

Samba Troubleshooting Tools

Non Destructive Tools

net view /workgroup:workgroupname Force a browser election on the server.
net view \\serverIP Test browseability on the client. Deduce whether failure to appear on network neighborhood is due to quirky Windows Explorer.
net use * \serverIP\sharename From client, access a share regardless of browseability.
net use lpt8: \\serverIP\printcapPrinterName Anything copied to lpt8: is routed to the Samba printer
net use Show all Samba resources used by the Win client.
smbclient '//serverIP/sharename' -Uusername From a Linux box or the server, access a share regardless of browseability.
smbclient -NL serverIP From Linux box, browse all browseable server resources.
ping serverIP Test connectivity to rule out connectivity causes.
tail -f log.nmb Watch nmbd log entries in real time.
tail -f log.smb Watch smbd log entries in real time.
  • Test smb.conf for legality of entries
  • View Global Defaults
  • View all settings for Samba server
  • Current Settings
  • Default Settings
  • Available Settings
  • Primary Synonyms
  • One Click HTML Help
  • View Connection, Share and File Activity
WARNING: Never go in as root unless you really want to change something. Even then, always back up before going in as root.
WARNING: SWAT can be a security problem, especially as root.
man smb.conf Ultimate authority on substitution chars, commands, etc.

Server-Changing Tools

/etc/rc.d/init.d/smb restart Restart Samba. Although not all smb.conf changes require a restart to be effective, restart always to start from a known state.
Tiny smb.conf Verify that Samba itself is working. Create a tiny setup whose every line serves to reproduce a problem and/or exploit differences.
Change workgroup name Reproduce browser timing problems on a Windows client. The client "remembers" workgroup names between sessions.
Make new share New share can reproduce the symptom, or fail to exhibit the symptom. One of each enables exploitation of differences.
Make your own log file Use preexec= and postexec=, with substitution variables and echo commands. May need to use root preexec= and root postexec=.
Make your own print command= Find out what Windows is sending to the printer.