Thursday, August 27, 2009

samba Virtual Servers

Virtual servers are a technique for creating the illusion of multiple NetBIOS servers on the network, when in reality there is only one. The technique is simple to implement: a machine simply registers more than one NetBIOS name in association with its IP address. There are tangible benefits to doing this.

The accounting department, for example, might have an accounting server, and clients of it would see just the accounting disks and printers. The marketing department could have their own server, marketing, with their own reports, and so on. However, all the services would be provided by one medium-sized Unix workstation (and one relaxed administrator), instead of having one small server and one administrator per department. Samba will allow a Unix server to use more than one NetBIOS name with the netbios aliases option.

netbios aliases

The netbios aliases option can be used to give the Samba server more than one NetBIOS name. Each NetBIOS name listed as a value will be displayed in the Network Neighborhood of a browsing machine. When a connection is requested to any machine, however, it will connect to the same Samba server.
This might come in handy, for example, if you’re transferring three departments’data to a single Unix server with modern large disks, and are retiring or reallocating the old NT servers. If the three servers are called sales, accounting, and admin, you can have Samba represent all three servers with the following options:

[global]

netbios aliases = sales marketing lab
include = /usr/local/samba/lib/smb.conf.%L

and in /usr/local/samba/lib/smb.conf.sales

[global]
workgroup = SALES
hosts allow = 192.168.10.255

so keep three conf file for each virtual server.

thats it

Smbwrapper

There is an entirely new version of the Unix client called smbwrapper.
Instead of a kernel module that allows Linux to act as a Samba client, there is now a command-line entry to load the library that provides a complete SMB filesystem on some brands of Unix. Once loaded, the command ls /smb will list all the machines in your workgroup, and cd /smb/server_name/share_name will take you to a particular share (shared directory), similar to the Network File System (NFS). As of this writing, smbwrapper currently runs on Linux, Solaris, SunOS 4, IRIX, and OSF/1, and is expected to run on several more operating systems in the near future.

An Overview of the Samba Distribution

Samba actually contains several programs that serve different but related purposes. Let’s introduce each of them briefly, and show how they work together. The majority of the programs that come with the Samba distribution center on its two daemons. Let’s take a refined look at the responsibilities of each daemon:

smbd

The smbd daemon is responsible for managing the shared resources between the Samba server machine and its clients. It provides file, print, and browser services to SMB clients across one or more networks. smdb handles all notifications between the Samba server and the network clients. In addition, it is responsible for user authentication, resource locking, and data sharing through the SMB protocol.

nmbd

The nmbd daemon is a simple nameserver that mimics the WINS and Net-BIOS name server functionality, as you might expect to encounter with the LAN Manager package. This daemon listens for nameserver requests and provides the appropriate information when called upon. It also provides browse lists for the Network Neighborhood and participates in browsing elections.

The Samba distribution also comes with a small set of Unix command-line tools:

smbclient

An FTP-like Unix client that can be used to connect to Samba shares

smbtar

A program for backing up data in shares, similar to the Unix tar command

nmblookup

A program that provides NetBIOS over TCP/IP name lookups

smbpasswd

A program that allows an administrator to change the encrypted passwords

used by Samba

smbstatus

A program for reporting the current network connections to the shares on a

Samba server

testparm

A simple program to validate the Samba configuration file

testprns

A program that tests whether various printers are recognized by the smbd

daemon