Debugging with Samba Itself
One of the best diagnostic tools for debugging problems is Samba itself. You can use the -d
option for both smbd and nmbd to specify the
debug level at which to run.
See the man pages for
smbd, nmbd
, and smb.conf for more information regarding debugging
options. The debug level (log level) can range from 1 (the default) to 10 (100 for debugging passwords).
Another helpful method of debugging is to compile Samba using the
gcc -g
flag. This will
include debug information in the binaries and allow you to attach
gdb
to the running
smbd/nmbd
process. To attach
gdb
to an
smbd
process
for an NT workstation, first get the workstation to make the connection. Pressing ctrl-alt-delete and going
down to the domain box is sufficient (at least, the first time you join the domain) to generate a
LsaEnumTrustedDomains
. Thereafter, the workstation maintains an open connection and
there will be an smbd process running (assuming that you haven't set a really short smbd idle timeout). So, in
between pressing
ctrl-alt-delete
and actually typing in your password, you can attach
gdb
and continue.
Some useful Samba commands worth investigating are:
$
testparm | more
$
smbclient -L //{netbios name of server}
|