Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Samba HowTo Guide
Prev Home Next

Multiple Virtual Server Personalities

Samba has the ability to host multiple virtual servers, each of which have their own personality. This is achieved by configuring an smb.conf file that is common to all personalities hosted. Each server personality is hosted using its own netbios alias name, and each has its own distinct [global] section. Each server may have its own stanzas for services and meta-services.

When hosting multiple virtual servers, each with their own personality, each can be in a different workgroup. Only the primary server can be a domain member or a domain controller. The personality is defined by the combination of the security mode it is operating in, the netbios aliases it has, and the workgroup that is defined for it.

This configuration style can be used either with NetBIOS names, or using NetBIOS-less SMB over TCP services. If run using NetBIOS mode (the most common method) it is important that the parameter smb ports = 139 should be specified in the primary smb.conf file. Failure to do this will result in Samba operating over TCP port 445 and problematic operation at best, and at worst only being able to obtain the functionality that is specified in the primary smb.conf file. The use of NetBIOS over TCP/IP using only TCP port 139 means that the use of the %L macro is fully enabled. If the smb ports = 139 is not specified (the default is 445 139 , or if the value of this parameter is set at 139 445 then the %L macro is not serviceable.

It is possible to host multiple servers, each with their own personality, using port 445 (the NetBIOS-less SMB port), in which case the %i macro can be used to provide separate server identities (by IP Address). Each can have its own security mode. It will be necessary to use the interfaces, bind interfaces only and IP aliases in addition to the netbios name parameters to create the virtual servers. This method is considerably more complex than that using NetBIOS names only using TCP port 139.

Consider an example environment that consists of a standalone, user-mode security Samba server and a read-only Windows 95 file server that has to be replaced. Instead of replacing the Windows 95 machine with a new PC, it is possible to add this server as a read-only anonymous file server that is hosted on the Samba server. Here are some parameters:

The Samba server is called ELASTIC, its workgroup name is ROBINSNEST. The CDROM server is called CDSERVER and its workgroup is ARTSDEPT. A possible implementation is shown here:

The smb.conf file for the master server is shown in Elastic smb.conf File. This file is placed in the /etc/samba directory. Only the nmbd and the smbd daemons are needed. When started the server will appear in Windows Network Neighborhood as the machine ELASTIC under the workgroup ROBINSNEST. It is helpful if the Windows clients that must access this server are also in the workgroup ROBINSNEST as this will make browsing much more reliable.

Example33.1.Elastic smb.conf File

# Global parameters
[global]
workgroup = ROBINSNEST
netbios name = ELASTIC
netbios aliases = CDSERVER
smb ports = 139
printcap name = cups
disable spoolss = Yes
show add printer wizard = No
printing = cups
include = /etc/samba/smb-%L.conf
[homes]
comment = Home Directories
valid users = %S
read only = No
browseable = No
[office]
comment = Data
path = /data
read only = No
[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0600
guest ok = Yes
printable = Yes
use client driver = Yes
browseable = No

The configuration file for the CDROM server is listed in CDROM Server smb-cdserver.conf file. This file is called smb-cdserver.conf and it should be located in the /etc/samba directory. Machines that are in the workgroup ARTSDEPT will be able to browse this server freely.

Example33.2.CDROM Server smb-cdserver.conf file

# Global parameters
[global]
workgroup = ARTSDEPT
netbios name = CDSERVER
map to guest = Bad User
guest ok = Yes
[carousel]
comment = CDROM Share
path = /export/cddata
read only = Yes
guest ok = Yes

The two servers have different resources and are in separate workgroups. The server ELASTIC can only be accessed by uses who have an appropriate account on the host server. All users will be able to access the CDROM data that is stored in the /export/cddata directory. File system permissions should set so that the others user has read-only access to the directory and its contents. The files can be owned by root (any user other than the nobody account).

Samba HowTo Guide
Prev Home Next

 
 
  Published under the terms fo the GNU General Public License Design by Interspire