Chapter 14: Sharing Files with Samba

Chapter 14: Sharing Files with Samba


Your Linux machine probably doesn't live alone on your network. If you have a PC running Windows, it's only natural that you would want to permit access to your Linux system's files and printers from those Windows machines with the standard Windows network protocol, SMB (Server Message Block). Mac OS X also supports SMB filesharing.

The standard filesharing software suite for Unix is called Samba. Not only does Samba allow your network's Windows computers to get to your Linux system, but it works the other way around — you can print and access files on Windows servers from your Linux machine with the included client software.

To set up a Samba server, you need to perform these steps:

  1. Create an smb.conf file.

  2. Add filesharing share sections to smb.conf.

  3. Add printer share sections to smb.conf.

  4. Start the Samba daemons: nmbd and smbd.

A share is a resource that you offer to a client, such as a directory or printer.

The discussion of Samba in this chapter is concise, limited to getting Windows machines on a single subnet to see a stand-alone Linux machine through the Windows Network Neighborhood browser. There are countless ways to configure Samba, because there are many possibilities for access control and network topology. For the gory details on how to configure a large-scale server, you will find How Samba Works [Lendecke] a much more extensive guide, and there is also information at the Samba Web site,