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

Standalone Server

A standalone server implies no more than the fact that it is not a domain controller and it does not participate in domain control. It can be a simple, workgroup-like server, or it can be a complex server that is a member of a domain security context.

As the examples are developed, every attempt is made to progress the system toward greater capability, just as one might expect would happen in a real business office as that office grows in size and its needs change.

Anonymous Read-Only Document Server

The purpose of this type of server is to make available to any user any documents or files that are placed on the shared resource. The shared resource could be a CD-ROM drive, a CD-ROM image, or a file storage area.

  • The file system share point will be /export.

  • All files will be owned by a user called Jack Baumbach. Jack's login name will be jackb . His password will be m0r3pa1n of course, that's just the example we are using; do not use this in a production environment because all readers of this document will know it.

Procedure2.1.Installation Procedure: Read-Only Server

Example2.1.Anonymous Read-Only Server Configuration

# Global parameters
[global]
workgroup = MIDEARTH
netbios name = HOBBIT
security = share
[data]
comment = Data
path = /export
read only = Yes
guest ok = Yes
  1. Add user to system (with creation of the user's home directory):

    root# 
    
    useradd -c "Jack Baumbach" -m -g users -p m0r3pa1n jackb
    
    

  2. Create directory, and set permissions and ownership:

    root# 
    
    mkdir /export
    
    root# 
    
    chmod u+rwx,g+rx,o+rx /export
    
    root# 
    
    chown jackb.users /export
    
    

  3. Copy the files that should be shared to the /export directory.

  4. Install the Samba configuration file (/etc/samba/smb.conf) as shown in Anonymous Read-Only Server Configuration.

  5. Test the configuration file by executing the following command:

    root# 
    
    testparm
    
    

    Alternatively, where you are operating from a master configuration file called smb.conf.master, the following sequence of commands might prove more appropriate:

    root#  cd /etc/samba
    root#  testparm -s smb.conf.master > smb.conf
    root#  testparm
    

    Note any error messages that might be produced. Proceed only if error-free output has been obtained. An example of typical output that should be generated from the above configuration file is shown here:

    Load smb config files from /etc/samba/smb.conf
    Processing section "[data]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    Press enter to see a dump of your service definitions
    
    [Press enter]
    
    
    # Global parameters
    [global]
    	workgroup = MIDEARTH
    	netbios name = HOBBIT
    	security = share
    
    [data]
    	comment = Data
    	path = /export
    	read only = Yes
    	guest only = Yes
    

  6. Start Samba using the method applicable to your operating system platform. The method that should be used is platform dependent. Refer to Starting Samba for further information regarding the starting of Samba.

  7. Configure your MS Windows client for workgroup MIDEARTH , set the machine name to ROBBINS, reboot, wait a few (2 - 5) minutes, then open Windows Explorer and visit the Network Neighborhood. The machine HOBBIT should be visible. When you click this machine icon, it should open up to reveal the data share. After you click the share, it should open up to reveal the files previously placed in the /export directory.

The information above (following # Global parameters) provides the complete contents of the /etc/samba/smb.conf file.

Anonymous Read-Write Document Server

We should view this configuration as a progression from the previous example. The difference is that shared access is now forced to the user identity of jackb and to the primary group jackb belongs to. One other refinement we can make is to add the user jackb to the smbpasswd file. To do this, execute:

root# 

smbpasswd -a jackb

New SMB password: 
m0r3pa1n

Retype new SMB password: 
m0r3pa1n

Added user jackb.

Addition of this user to the smbpasswd file allows all files to be displayed in the Explorer Properties boxes as belonging to jackb instead of to User Unknown .

The complete, modified smb.conf file is as shown in ???.

Example2.2.Modified Anonymous Read-Write smb.conf

# Global parameters
[global]
workgroup = MIDEARTH
netbios name = HOBBIT
security = SHARE
[data]
comment = Data
path = /export
force user = jackb
force group = users
read only = No
guest ok = Yes

Anonymous Print Server

An anonymous print server serves two purposes:

  • It allows printing to all printers from a single location.

  • It reduces network traffic congestion due to many users trying to access a limited number of printers.

In the simplest of anonymous print servers, it is common to require the installation of the correct printer drivers on the Windows workstation. In this case the print server will be designed to just pass print jobs through to the spooler, and the spooler should be configured to do raw pass-through to the printer. In other words, the print spooler should not filter or process the data stream being passed to the printer.

In this configuration, it is undesirable to present the Add Printer Wizard, and we do not want to have automatic driver download, so we disable it in the following configuration. ??? is the resulting smb.conf file.

Example2.3.Anonymous Print Server smb.conf

# Global parameters
[global]
workgroup = MIDEARTH
netbios name = LUTHIEN
security = share
printcap name = cups
disable spoolss = Yes
show add printer wizard = No
printing = cups
[printers]
comment = All Printers
path = /var/spool/samba
guest ok = Yes
printable = Yes
use client driver = Yes
browseable = No

The above configuration is not ideal. It uses no smart features, and it deliberately presents a less than elegant solution. But it is basic, and it does print. Samba makes use of the direct printing application program interface that is provided by CUPS. When Samba has been compiled and linked with the CUPS libraries, the default printing system will be CUPS. By specifying that the printcap name is CUPS, Samba will use the CUPS library API to communicate directly with CUPS for all printer functions. It is possible to force the use of external printing commands by setting the value of the printing to either SYSV or BSD, and thus the value of the parameter printcap name must be set to something other than CUPS. In such case, it could be set to the name of any file that contains a list of printers that should be made available to Windows clients.

Samba HowTo Guide
Prev Home Next

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