Network Administration: Linux Samba Basics

Samba refers to a file- and printer-sharing program that allows Linux to mimic a Windows file and print server so that Windows computers can use shared Linux directories and printers. If you want to use Linux as a file or print server in a Windows network, you’ll need to know how to dance the Samba.

Because Linux and Windows have such different file systems, you can’t create a Linux file server simply by granting Windows users access to Linux directories. Windows client computers wouldn’t be able to access files in the Linux directories. Too many differences exist between the file systems. For example:

  • Linux filenames are case sensitive, whereas Windows filenames are not. For example, in Windows, File1.txt and file1.txt are the same file. In Linux, they’re different files.

  • In Linux, periods aren’t used to denote file extensions. Linux filenames don’t use extensions.

  • Windows has file attributes like read-only and archive. Linux doesn’t have these.

More fundamentally, Windows networking uses a protocol called SMB, which stands for Server Message Block, to manage the exchange of file data among file servers and clients. Linux doesn’t have SMB support built in.

That’s why Samba is required. Samba is a program that mimics the behavior of a Windows-based file server by implementing the SMB protocol. So when you run Samba on a Linux server, the Windows computers on your network see the Linux server as if it were a Windows server.

Like a Windows server, Samba works by designating certain directories as shares. A share is simply a directory that’s made available to other users via the network. Each share has the following elements:

  • Share name: The name by which the share is known over the network. Share names should be eight characters whenever possible.

  • Path: The path to the directory on the Linux computer that’s being shared, such as UsersDoug.

  • Description: A one-line description of the share.

  • Access: A list of users or groups who have been granted access to the share.

Samba also includes a client program that lets a Linux computer access Windows file servers.

Why did Samba’s developers choose to call their program Samba? Simply because the protocol that Windows file and print servers use to communicate with each other is called SMB, which stands for Server Message Block. Add a couple of vowels to SMB, and you get Samba.