11.3 Configuration Scripts

Everyone needs tools. Some of us like to create our own, others prefer to use canned tools (i.e., prepared by someone else for general use).

11.3.1 Sample smb.conf Add Group Script

A script to create complying group names for use by the Samba group interfaces is provided in Example 11.1.

The smb.conf entry for the above script would be something like that in Example 11.2.

Example 11.1  
 #!/bin/bash # Add the group using normal system groupadd tool. groupadd smbtmpgrp00 thegid='cat /etc/group  grep smbtmpgrp00  cut -d ":" -f3' # Now change the name to what we want for the MS Windows networking end cp /etc/group /etc/group.bak cat /etc/group.bak  sed s/smbtmpgrp00//g > /etc/group # Now return the GID as would normally happen. echo $thegid exit 0 
Example 11.2 Configuration of smb.conf for the add group script.
  [global]  ...  add group script = /path_to_tool/smbgrpadd.sh %g  ... 

11.3.2 Script to Configure Group Mapping

In our example we have created a UNIX/Linux group called ntadmin . Our script will create the additional groups Orks , Elves , and Gnomes . It is a good idea to save this shell script for later re-use just in case you ever need to rebuild your mapping database. For the sake of concenience we elect to save this script as a file called initGroups.sh . This script is given in Example 11.3.

Of course it is expected that the administrator will modify this to suit local needs. For information regarding the use of the net groupmap tool please refer to the man page.

Official Samba-3 HOWTO and Reference Guide
The Official Samba-3 HOWTO and Reference Guide, 2nd Edition
ISBN: 0131882228
EAN: 2147483647
Year: 2005
Pages: 297

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