Primer on Samba
The ability to share files and printers between multiple systems has become a requirement for many applications and systems. As datacenters become more complex, it's critical for data to reside in one location and be accessed from multiple servers without having to move the data around.
In other eServer Magazine, IBM edition for UNIX articles, I've discussed the implementation of Network File Server (NFS) v4 as a possible solution for data sharing. This article will provide an introduction to Samba--another file-sharing option. (Note: Look for a future article in eServer Magazine, IBM edition for UNIX, which will provide more detail on configuring Samba for security and performance.)
Samba is a set of programs that allows clients to access server file systems and printers using the Common Internet File System (CIFS) and the Server Message Block (SMB) protocols. Samba runs on most varieties of UNIX, Linux and many other platforms. It's available free of charge according to the rules of the GNU Public License and can be downloaded from the Samba Web site (www.samba.org).
Why Samba and Not NFS?
When sharing files via NFS between Windows and UNIX systems, or other disparate systems, both ends of the transaction must run NFS software. One end must run the server daemons, and the other must run the client daemons. In a Windows environment, this normally means purchasing software to install on the PC to act as a client. For large environments, this cost adds up very quickly. Since Samba is free and based on already-installed protocols such as Network Basic Input/Output System (NetBIOS) and SMB, this extra cost isn't an issue. Additionally, Samba allows you to control file and print services from one or more servers, whereas NFS controls only file services.
As previously mentioned, Samba uses the SMB and CIFS protocols. This allows clients and servers to exchange messages and data and enables UNIX systems to act as file and print servers for client systems. These clients can be Windows systems or other UNIX systems. The key is that the services provided appear as Windows file and print services. SMB client utilities are also provided for UNIX systems, and since Windows clients already support NetBIOS over TCP/IP, they don't require additional software beyond allowing NetBIOS access.
Samba is very reliable and provides good performance under a heavy load. It runs on multiple different flavors of UNIX and Linux. Of course, no client software is necessary because support is already part of Windows, and SMB clients for UNIX are provided with Samba free of charge.
Features of Samba
A Samba server can provide many useful services and functions on the network. The primary feature is the ability to provide Windows-like SMB file and print servers. This can be done with good granularity in security through the configuration file, which is normally /etc/samba/smb.conf. Samba comes with both a Web-based configuration tool called SWAT and a set of command-line commands to help set up and control Samba.