Section 1.2. What Can Samba Do for Me?


1.2. What Can Samba Do for Me?

As explained earlier, Samba can help Windows and Unix computers coexist in the same network.[*] However, there are some specific reasons why you might want to set up a Samba server on your network:

[*] The name Unix will be used throughout this book to mean Unix and Unix-like variants such as BSD, Linux, SysV, and Mac OS X.

  • You do not needor wish to pay fora full-fledged Windows server, yet you need the file and print functionality that one provides.

  • You want to provide a common area for data or user directories to transition from a Windows server to a Unix one, or vice versa.

  • You want to share printers among Windows and Unix workstations.

  • You are supporting a group of computer users who have a mixture of Windows and Unix computers.

  • You want to integrate Unix and Windows authentication, maintaining a single database of user accounts that works with both systems.

  • You want to network Unix, Windows, Macintosh (OS X), and other systems using a single protocol.

Let's take a quick tour of Samba in action. Imagine the following basic network configuration: a Samba-enabled Unix system, to which we will assign the name RAIN, and a pair of Windows clients, to which we will assign the names LETTUCE and TOMATO, all connected via a local area network (LAN). The server RAIN has a local inkjet printer connected to it, inkprint, and a disk share named documentsboth of which it can offer to the other two computers. A graphic of this network is shown in Figure 1-1.

Figure 1-1. A simple network set up with a Samba server


In this network, each computer listed shares the same workgroup. A workgroup is a group name tag that identifies an arbitrary collection of computers and their resources on an SMB/CIFS network. Several workgroups can be on the network at any time, but for our basic network example, we'll have only one: the GARDEN workgroup.

1.2.1. Sharing Files

If everything is properly configured, we should be able to see the Samba server, RAIN, through the My Network Places directory on the Windows desktop, as shown in Figure 1-2. In fact, you should also be able to see each host that belongs to the GARDEN workgroup. Note the Microsoft Windows Network icon in the lefthand toolbar. As we just mentioned, more than one workgroup can exist on a network at any given time. A user who clicks this icon will see a list of all the workgroups that currently exist on the network.

Figure 1-2. Viewing the members of a workgroup using My Network Places on a Windows client


We can take a closer look at the RAIN server by double-clicking its icon. This action causes the client to contact the server and request a list of its sharesthe file and printer resourcesthat the computer provides. In this case, a printer named inkprint and a disk share named documents are on the server, as shown in Figure 1-3. Thanks to Samba, Windows sees the Unix server as a valid CIFS server and clients are able to access the documents folder as if it were just another directory on a local disk. Note that Windows displays the names of machines in mixed case (Rain). Case is irrelevant in NetBIOS and DNS names, so you might see rain, Rain, and RAIN in various displays or command output, but they all refer to a single system.

Figure 1-3. Shares available on the Samba host \\RAIN


One popular Windows feature is the capability to map a drive letter (such as H:) to a remote shared directory. To create a path that points to a remote directory or printer, combine the server (\\RAIN) and share name (documents) to form a Universal Naming Convention (UNC) path (\\RAIN\documents). There are several methods of creating such a connection. One that works across almost all Windows operating systems versions is the net.exe command. The following command connects the P: driver letter to the documents share on RAIN:

 C:\> net use p: \\rain\documents 

Once this drive mapping is established, applications can access the files in the documents folder across the network as if it were an additional local hard disk mounted at P:\. You can store data on it, install and run programs from it, and even restrict access to prevent unwanted visitors. If you have any applications that support multiuser functionality on a network, you can install those programs on the network drive.[*] Figure 1-4 shows the resulting network drive as it would appear with other storage devices in the Windows XP client. Note the pipeline attachment in the icon for the P: drive; this indicates that it is a network drive rather than a fixed drive.

[*] Be warned that many end-user license agreements forbid installing a program on a network so that multiple clients can access it. Check the legal agreements that accompany the product to be absolutely sure.

Figure 1-4. Displaying local and network drives in My Computer


1.2.2. Sharing a Printer

You probably noticed that the printer inkprint appeared under the available shares for RAIN in Figure 1-3, indicating that the Unix server has a printer that can be accessed by various clients. Data sent to the printer from any of the clients will be spooled on the Unix server and printed in the order in which it is received.

Connecting to a Samba printer from a Windows client is even easier than creating a mapping to a disk share. Windows systems support a system called Point and Print by which clients can automatically download the correct driver for a shared printer, and this system works with Samba shared printers just as easily as with Windows Server shared printers. Merely by double-clicking on the printer, the client downloads the necessary files from the server and creates a usable printer connection. An application can then access the print share using the same mechanisms as it would for a local printer. Figure 1-5 display a printer connection to \\RAIN\inkprint along with a local printer named HP LaserJet. Again, note the pipeline attachment below the printer, which identifies it as being on a network. More information on configuring Samba's printer and driver management features is provided in Chapter 7.

Figure 1-5. A client connection to the printer Q1 on the server RAIN


1.2.3. Seeing Things from the Unix Side

As mentioned earlier, Samba appears in Unix as a set of daemon programs. You can view them with the Unix ps command, you can read any messages they generate through custom debug files or the Unix syslog service (depending on how Samba is set up), and you can configure them from a single Samba configuration file: smb.conf. Additionally, if you want to get an idea of what the daemons are doing, Samba has a program called smbstatus, which displays the current state of the server's open client connections and file locks. Here's an example that shows that the user lizard has a connection to the documents share from the machine lettuce.

 $ smbstatus Samba version 3.0.22 PID     Username    Group    Machine ------------------------------------------------------- 19889   lizard       users    lettuce (192.168.1.143) Service      pid     machine       Connected at ------------------------------------------------------- documents    19889   lettuce       Fri Jun  3 01:34:46 2006 No locked files 




Using Samba
Using Samba: A File and Print Server for Linux, Unix & Mac OS X, 3rd Edition
ISBN: 0596007698
EAN: 2147483647
Year: 2004
Pages: 135

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net