~ CHAPTER 20:
SAMBA ~
Samba is a powerful tool for allowing UNIX-based systems (such as Linux) to interoperate
with Windows-based systems. Samba does this by understanding the Microsoft networking
protocol, SMB (Session Message Block). From a system administrator’s point of view, this
means being able to deploy a UNIX-based server without having to install NFS, LP, and
some kind of UNIX-compatible authentication support on all the Windows clients in the entwork.
In terms of administration, you’ll get a short course on using Samba’s Web Administration
Tool (SWAT), and on the smbclient command-line utility.
NOTE: Samba can actually been ported to a significant number of platforms – almost
any variant of UNIX you can imagine, and even several non-UNIX environments.
Usernames and Passwords
against the PDC. This means you still have two user lists – one local and one on the PDC—
but your users need only keep track of their passwords on the Windows system.
systems, while all your Windows boxes authenticate with Samba.
For sites with a well-established system for maintaining logins and passwords, it isn’t
unreasonable to come up with a custom script.
======================================================================
linux20.html PAGE 2 2002/07/20
Encrypted Passwords
Starting with Windows NT 4/Service Pack 3, Windows 98, and Windows 95 OSR2, Windows
uses encrypted passwords when communicating with the PDC and any server requiring authentication
(including Linux and Samba).
Edit the Registry on Windows clients to disable use of encrypted passwords. The Registry entries
that need to be changed are listed in the docs directory in the Samba package.
Configure Samba to use Windows-style encrypted passwords
The Differences Between smbd and nmbd
The code of the Samba server is actually composed of two
daemons: smbd and nmbd.
Compiling and Installing Samba
Samba comes installed on most Linux distributions. Nevertheless, like all the other
services we’ve discussed in this boot, you should be able to compile the software
yourself in the event you want to upgrade the package to a new release.
that directory.
cd^source
Samba installation.
installation.
Starting and Stopping Samba
Most distributions of Linux have scripts that will start and stop Samba without your needing to
pay much attention. To stop the service using this script, you would run:
/etc/rc.d/init.d/smb^stop
Setting up Swat
SWAT is the Samba Web Administration Tool with which you can manage Samba through
a browser interface. It is an excellent alternative to editing the Samba configuration files by
hand, but don’t let it make you believe that the configuration files are complex!
======================================================================
linux20.html PAGE 3 2002/07/20
What makes SWAT a little different from other browsers-based administration tools is that
SWAT does not rely on a Web server (like Apache). Instead, SWAT performs all the needed
Web server functions without implementing a full Web server. This is mostly accomplished
by running through the inetd daemon.
Using SWAT from Other Hosts
If you used ineted, then you can use SWAT from an other host as long as it has TCP/IP
connectivity and a Web browser.
The SWAT Menus
When you connect to SWAT and login as root, you’ll see the main menu shown in page 455.
Unable to launch at school, did not work.
Using smbclient
The smbclient program is a command-line tool that allows your Linux system to act as a
Windows client. You can use this utility to connect to other Samba servers or even to real
Windows NT/2000 server.
smbclient is a very flexible program and can be used to browse other servers, send and
retrieve files from them, or even print to them.
Browsing a Server
smbclient—similar to nslookup.
If you have multiple files: use the mget and the mput commands.
Remote File Access
Smbclient utility allows you to access files on an NT or Samba server with a command-line
hybrid DOS/FTP client interface.
/usr/local/samba/bin/smbclient^//server/share
Allowing NULL Passwords
If you have a need to allow users to have no passwords (which is a bad idea), you can do
so by using the smbpasswd program with the –n option, like so:
smbpasswd^-n^username
======================================================================
linux20.html PAGE 4 2002/07/20
Troubleshooting Samba
There are four typical solutions to connectivity problems
with Samba.
state or you’ve made changes to the configuration but forgot to restart Samba so that
the changes take effect.
typically in directory names, usernames, network numbers, and host names.
configured to use them and the clients aren’t, or (more likely) the clients are using
encrypted passwords and Samba hasn’t been configured to use them. See the docs
subdirectory and you may need to use regedit to change the Registry.
Summary: