Apr 26, 2004 (10:04 AM EDT)
Do-It-Yourself: How To Do The Samba

Read the Original Article at InformationWeek

1   2   3  
Here's a fun, useless Samba fact to get this article going: Samba was not named for the dance. Rather, Andrew Tridgell, who currently heads up the Samba development team, named the software in 1991 for the first three letters of Server Message Block, which is the underlying network technology that Samba is based on.

Tridgell ran a dictionary search and found there are only four actual words that include the letters S-M-B in sequence: "salmonberry," "samba," "sawtimber" and "scramble."

And so Samba was born.

It could have been named "salmonberry."

What is Samba, Anyway?
SMB is the file sharing protocol of choice for most operating systems, including Linux and Windows. SMB was created about 20 years ago.

Samba is an open source project, designed to facilitate networking data between compliant systems, that is, systems that can communicate by the SMB protocol, usually over TCP/IP.

SMB networking is mostly a request-response system: a client application sends out a request across the net to a server. The server ponders and operates on that request, then sends the resulting response (which often contains data and request status) back to the requesting client, and so on.

On Linux systems Samba is comprised of two processes, usually started up when the system starts, named smbd  and nmbd.  These are background processes, known in Linux as daemons. When started, smbd  reads a file called smb.conf , usually found in the /etc/samba  directory. This is a straight text file, describing file shares, printers, and other network devices, their resident systems and other esoteric networky stuff. Intrinsically, it provides for excellent security, both on the corporate intranet and public internet. It's easy to configure either, through dedicated GUI front-ends or simple text editors.

The configuration file is comprised of a few sections, named global , homes  and printers.  Each section name is delimited by square brackets. Blank lines are ignored; non-blank lines are considered parameters and are each generally of the form of varname=value  (example: public=yes )

You can find a detailed explanation of Samba parameters in the Samba documentation.

The simplest functioning configuration file is likely:

[global]
workgroup = MYWORKGROUP

[homes]

guest ok = yes
read only = no
 

Now, this doesn't provide any security. Therefore, you shouldn't use it. It provides for an area called MYWORKGROUP  on the server running Samba to anyone logged onto the server, and lets them modify or delete any file.

Samba is usually installed by default on most Linux systems. You need only put your devices and shares in smb.conf,  tweak security until satisfied, and restart the smbd  daemon.

Assuming the configuration files had no errors, you're done and able to transfer files between networked machines easily.

The smb.conf  File
Every smb.conf  must have a [global]  section and should have at least one section defining common directories, such as /tmp . The file can optionally include a [homes]  section, defining directories by easily accessible names, along with their parameters for commonly accessed directories, such as spool directories for printers and the intermediate work files they require.