Sometimes UNIX computers are on networks with computers running other operating systems, such as Windows 98, Me, NT, 2000, or XP. So how do you get your UNIX and Windows computers to communicate with each other?
When computers want to speak to one another, they can’t just chuck data at one another indiscriminately. They have to use what’s known in computer-ese as protocols. Protocols are sets of rules by which computers exchange data and commands. If two computers know the same protocols, they can talk turkey, even if one of those computers is running UNIX and the other is running Windows.
Computers use all kinds of protocols to communicate. On a network, clients connect to servers by using protocols, such as TCP/IP (Transmission Control Protocol/Internet Protocol) and IPX (Internetwork Packet eXchange). Computers connected by way of the Internet exchange files by using protocols such as FTP (File Transfer Protocol) and HTTP (HyperText Transfer Protocol).
The particular protocol of interest here is the Server Message Block, or SMB, protocol. SMB has been around in one incarnation or another since 1987, when Microsoft and Intel (the chip maker) first defined it. Because they helped to invent SMB, Microsoft includes an SMB client in all its versions of Windows. Any server that can talk SMB, therefore, can do business with a Windows computer, so the Windows computers can use disks and printers on the server just like on a Windows NT server, for example. Enter Andrew Tridgell, a UNIX hacker from Canberra, Australia, with a firm grasp of the obvious. He wrote a suite of programs collectively named Samba, which turns almost any version of UNIX you care to mention into an SMB server. Samba lets UNIX and Windows computers do snazzy, friendly stuff, such as access one another’s files and share printers. In typical UNIX style, dozens of programmers from around the world have contributed to Samba over the years, and it’s distributed for free under the infamous GNU public software guidelines.
SMB is a request-response protocol, in which a client makes requests of the server and the server responds. Because nothing is ever as easy at it seems where computers are concerned, a client has to make several requests of a server before anything useful happens. First, the client has to ask the server which dialect of SMB it wants to speak (yup, dialect, just like in real life). Then the client has to get down on bended knee and politely request access to the server by giving the server a username and password. If the server grants the client an audience, the client can start petitioning the server with a series of requests — for example, to locate, open, and print a particular file.
The latest version of Samba is 2.2.8 or higher. Nearly all current versions of UNIX come with Samba installed, or you can download it from one of the Samba Web sites such as Chapter 19.)
Samba lets a UNIX system provide file and printer service to Windows machines. Occasionally you need to go the other way, either to copy a bunch of files or to use a remote Windows disk.
Samba includes a program called smbclient that works sort of like FTP (see Chapter 18) to copy files to or from a Windows shared folder. Some UNIX systems also have an SMB mounter that can mount remote Windows folders on the local machine just like remote NFS disks. Check with your system manager if you need to set this up.