First and foremost, Samba is a file- and printer-sharing tool. File sharing refers to the ability to mount a remote filesystem on a client as if it were local. Ordinary applications on the client can then directly access files on the server ”a text editor can load files, the user can edit them, and they can be saved directly back to the server, for instance. This type of operation is most useful in office environments to consolidate the storage of users' files and applications on a single server. Printer sharing involves giving clients access to printers controlled from the server. It's useful in saving resources by allowing many computers to use the same pool of printers. These are the general tasks to which Samba may be applied.
Because of the NetBIOS and SMB/CIFS heritage in DOS and Windows, it's not surprising that Samba is most useful on networks that include DOS and Windows systems. Samba provides features that are tailored to the needs of these computers. For instance, DOS and Windows use case-insensitive filesystems, so that FILE.TXT , file.txt , File.txt , and other filenames that differ only in case are equivalent. Linux, by contrast, uses a case-sensitive filesystem, so these filenames are all different. Samba includes features to help bridge this gap, allowing Samba to serve files in a case-insensitive manner. Also, SMB/CIFS provides support for features of DOS and Windows filesystems like hidden and archive bits. These are flags to indicate that a file should be hidden from users under most circumstances, or that the file has been backed up. Linux filesystems don't include these features, so Samba provides a way to provide these bits. Samba's extensive support for these and other SMB/CIFS features makes Samba the ideal way to share files with DOS and Windows systems. A few other OSs, such as IBM's OS/2, have similar requirements and also support SMB/CIFS, so Samba is an excellent file-sharing tool for these OSs, as well.
Samba can be a useful tool even on networks that don't use DOS, Windows, OS/2, or other OSs for which SMB/CIFS is the preferred file-sharing protocol. UNIX and Linux systems, Macintoshes, BeOS systems, and others all support SMB/CIFS, either through native tools or through third-party packages. Linux often supports protocols that are more appropriate for these platforms (such as NFS for Unix and Linux systems, discussed in Chapter 8, File Sharing via NFS), but sometimes using Samba can be beneficial even in these cases. For instance, you might prefer to run as few servers as possible, and make do with SMB/CIFS for file sharing with non-Windows platforms. NFS and SMB/CIFS also use very different security models, and in some situations the SMB/CIFS security system (which uses usernames and passwords for authentication) may be preferable to the NFS model (which uses IP addresses and the client's own security).